diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-12-07 15:37:24 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-12-07 15:02:55 +0100 |
commit | fac39c198324715565897f4240709340477af0bf (patch) | |
tree | 9a29a3664fca0867fd1ed2126031e9aae95c22df | |
parent | faac31521bb7ecbf999541cf918d3750ff589de4 (diff) |
wallet: document that tx in CreateTransaction is purely an out-param
-rw-r--r-- | src/wallet/wallet.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 65b54f39b4..330559d0dd 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3109,13 +3109,14 @@ bool CWallet::CreateTransaction( bool sign) { int nChangePosIn = nChangePosInOut; - CTransactionRef tx2 = tx; + Assert(!tx); // tx is an out-param. TODO change the return type from bool to tx (or nullptr) bool res = CreateTransactionInternal(vecSend, tx, nFeeRet, nChangePosInOut, error, coin_control, fee_calc_out, sign); // try with avoidpartialspends unless it's enabled already if (res && nFeeRet > 0 /* 0 means non-functional fee rate estimation */ && m_max_aps_fee > -1 && !coin_control.m_avoid_partial_spends) { CCoinControl tmp_cc = coin_control; tmp_cc.m_avoid_partial_spends = true; CAmount nFeeRet2; + CTransactionRef tx2; int nChangePosInOut2 = nChangePosIn; bilingual_str error2; // fired and forgotten; if an error occurs, we discard the results if (CreateTransactionInternal(vecSend, tx2, nFeeRet2, nChangePosInOut2, error2, tmp_cc, fee_calc_out, sign)) { |