wallet: CreateTransaction(): return out-params as (optional) struct

This commit is contained in:
Sebastian Falbesoner
2020-12-13 03:15:40 +01:00
parent c9fdaa5e3a
commit 4c5ceb040c
7 changed files with 52 additions and 71 deletions

View File

@@ -257,13 +257,14 @@ public:
bilingual_str& fail_reason) override
{
LOCK(m_wallet->cs_wallet);
CTransactionRef tx;
FeeCalculation fee_calc_out;
if (!CreateTransaction(*m_wallet, recipients, tx, fee, change_pos,
fail_reason, coin_control, fee_calc_out, sign)) {
return {};
}
return tx;
std::optional<CreatedTransactionResult> txr = CreateTransaction(*m_wallet, recipients, change_pos,
fail_reason, coin_control, fee_calc_out, sign);
if (!txr) return {};
fee = txr->fee;
change_pos = txr->change_pos;
return txr->tx;
}
void commitTransaction(CTransactionRef tx,
WalletValueMap value_map,