aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/interfaces.cpp
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2020-12-13 03:15:40 +0100
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2022-05-16 17:46:34 +0200
commit4c5ceb040cf50d24201903a9200fb23be88d96fb (patch)
treeb3b1fc04fdd06e41166c461a2e272d52ffe3f981 /src/wallet/interfaces.cpp
parentc9fdaa5e3ae09b45be6a5c2d4ee6b1e8cef9d8a8 (diff)
downloadbitcoin-4c5ceb040cf50d24201903a9200fb23be88d96fb.tar.xz
wallet: CreateTransaction(): return out-params as (optional) struct
Diffstat (limited to 'src/wallet/interfaces.cpp')
-rw-r--r--src/wallet/interfaces.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/wallet/interfaces.cpp b/src/wallet/interfaces.cpp
index 98e843385c..b269137254 100644
--- a/src/wallet/interfaces.cpp
+++ b/src/wallet/interfaces.cpp
@@ -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,