11
11
#include < util/fees.h>
12
12
#include < util/moneystr.h>
13
13
#include < util/rbf.h>
14
+ #include < util/trace.h>
14
15
#include < util/translation.h>
15
16
#include < wallet/coincontrol.h>
16
17
#include < wallet/fees.h>
@@ -792,6 +793,7 @@ static bool CreateTransactionInternal(
792
793
error = _ (" Insufficient funds" );
793
794
return false ;
794
795
}
796
+ TRACE5 (coin_selection, selected_coins, wallet.GetName ().c_str (), GetAlgorithmName (result->m_algo ).c_str (), result->m_target , result->GetWaste (), result->GetSelectedValue ());
795
797
796
798
// Always make a change output
797
799
// We will reduce the fee from this change output later, and remove the output if it is too small.
@@ -982,8 +984,10 @@ bool CreateTransaction(
982
984
int nChangePosIn = nChangePosInOut;
983
985
Assert (!tx); // tx is an out-param. TODO change the return type from bool to tx (or nullptr)
984
986
bool res = CreateTransactionInternal (wallet, vecSend, tx, nFeeRet, nChangePosInOut, error, coin_control, fee_calc_out, sign);
987
+ TRACE4 (coin_selection, normal_create_tx_internal, wallet.GetName ().c_str (), res, nFeeRet, nChangePosInOut);
985
988
// try with avoidpartialspends unless it's enabled already
986
989
if (res && nFeeRet > 0 /* 0 means non-functional fee rate estimation */ && wallet.m_max_aps_fee > -1 && !coin_control.m_avoid_partial_spends ) {
990
+ TRACE1 (coin_selection, attempting_aps_create_tx, wallet.GetName ().c_str ());
987
991
CCoinControl tmp_cc = coin_control;
988
992
tmp_cc.m_avoid_partial_spends = true ;
989
993
CAmount nFeeRet2;
@@ -994,6 +998,7 @@ bool CreateTransaction(
994
998
// if fee of this alternative one is within the range of the max fee, we use this one
995
999
const bool use_aps = nFeeRet2 <= nFeeRet + wallet.m_max_aps_fee ;
996
1000
wallet.WalletLogPrintf (" Fee non-grouped = %lld, grouped = %lld, using %s\n " , nFeeRet, nFeeRet2, use_aps ? " grouped" : " non-grouped" );
1001
+ TRACE5 (coin_selection, aps_create_tx_internal, wallet.GetName ().c_str (), use_aps, res, nFeeRet2, nChangePosInOut2);
997
1002
if (use_aps) {
998
1003
tx = tx2;
999
1004
nFeeRet = nFeeRet2;
0 commit comments