diff options
author | Richard Myers <remyers@yakshaver.org> | 2024-01-17 15:57:02 +0100 |
---|---|---|
committer | Richard Myers <remyers@yakshaver.org> | 2024-01-20 14:56:41 +0100 |
commit | 2d58629ee63eebc760e2a9226afcd0c46d3ec2bd (patch) | |
tree | 65504074892710f9f31d1d4fe557b7389801b885 /src | |
parent | 8106b268cde8e97a7c330afdda39b6bb55e5574a (diff) |
wallet: fix coin selection tracing to return -1 when no change pos
Diffstat (limited to 'src')
-rw-r--r-- | src/wallet/spend.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wallet/spend.cpp b/src/wallet/spend.cpp index b51cd6332f..5b464ae3f5 100644 --- a/src/wallet/spend.cpp +++ b/src/wallet/spend.cpp @@ -1337,7 +1337,7 @@ util::Result<CreatedTransactionResult> CreateTransaction( auto res = CreateTransactionInternal(wallet, vecSend, change_pos, coin_control, sign); TRACE4(coin_selection, normal_create_tx_internal, wallet.GetName().c_str(), bool(res), - res ? res->fee : 0, res && res->change_pos.has_value() ? *res->change_pos : 0); + res ? res->fee : 0, res && res->change_pos.has_value() ? int32_t(*res->change_pos) : -1); if (!res) return res; const auto& txr_ungrouped = *res; // try with avoidpartialspends unless it's enabled already @@ -1355,7 +1355,7 @@ util::Result<CreatedTransactionResult> CreateTransaction( // if fee of this alternative one is within the range of the max fee, we use this one const bool use_aps{txr_grouped.has_value() ? (txr_grouped->fee <= txr_ungrouped.fee + wallet.m_max_aps_fee) : false}; TRACE5(coin_selection, aps_create_tx_internal, wallet.GetName().c_str(), use_aps, txr_grouped.has_value(), - txr_grouped.has_value() ? txr_grouped->fee : 0, txr_grouped.has_value() && txr_grouped->change_pos.has_value() ? *txr_grouped->change_pos : 0); + txr_grouped.has_value() ? txr_grouped->fee : 0, txr_grouped.has_value() && txr_grouped->change_pos.has_value() ? int32_t(*txr_grouped->change_pos) : -1); if (txr_grouped) { wallet.WalletLogPrintf("Fee non-grouped = %lld, grouped = %lld, using %s\n", txr_ungrouped.fee, txr_grouped->fee, use_aps ? "grouped" : "non-grouped"); |