@@ -108,12 +108,11 @@ static feebumper::Result CheckFeeRate(const CWallet& wallet, const CWalletTx& wt
108
108
return feebumper::Result::OK;
109
109
}
110
110
111
- static CFeeRate EstimateFeeRate (const CWallet& wallet, const CWalletTx& wtx, CCoinControl& coin_control, CAmount& old_fee )
111
+ static CFeeRate EstimateFeeRate (const CWallet& wallet, const CWalletTx& wtx, const CAmount old_fee, CCoinControl& coin_control )
112
112
{
113
113
// Get the fee rate of the original transaction. This is calculated from
114
114
// the tx fee/vsize, so it may have been rounded down. Add 1 satoshi to the
115
115
// result.
116
- old_fee = wtx.GetDebit (ISMINE_SPENDABLE) - wtx.tx ->GetValueOut ();
117
116
int64_t txSize = GetVirtualTransactionSize (*(wtx.tx ));
118
117
CFeeRate feerate (old_fee, txSize);
119
118
feerate += CFeeRate (1 );
@@ -309,6 +308,8 @@ Result CreateRateBumpTransaction(CWallet& wallet, const uint256& txid, const CCo
309
308
}
310
309
}
311
310
311
+ old_fee = wtx.GetDebit (ISMINE_SPENDABLE) - wtx.tx ->GetValueOut ();
312
+
312
313
if (coin_control.m_feerate ) {
313
314
// The user provided a feeRate argument.
314
315
// We calculate this here to avoid compiler warning on the cs_wallet lock
@@ -319,7 +320,7 @@ Result CreateRateBumpTransaction(CWallet& wallet, const uint256& txid, const CCo
319
320
}
320
321
} else {
321
322
// The user did not provide a feeRate argument
322
- new_coin_control.m_feerate = EstimateFeeRate (wallet, wtx, new_coin_control, old_fee );
323
+ new_coin_control.m_feerate = EstimateFeeRate (wallet, wtx, old_fee, new_coin_control );
323
324
}
324
325
325
326
// Fill in required inputs we are double-spending(all of them)
0 commit comments