File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1467,10 +1467,18 @@ RPCHelpMan sendall()
14671467 }
14681468 }
14691469
1470+ std::vector<COutPoint> outpoints_spent;
1471+ outpoints_spent.reserve (rawTx.vin .size ());
1472+
1473+ for (const CTxIn& tx_in : rawTx.vin ) {
1474+ outpoints_spent.push_back (tx_in.prevout );
1475+ }
1476+
14701477 // estimate final size of tx
14711478 const TxSize tx_size{CalculateMaximumSignedTxSize (CTransaction (rawTx), pwallet.get ())};
14721479 const CAmount fee_from_size{fee_rate.GetFee (tx_size.vsize )};
1473- const CAmount effective_value{total_input_value - fee_from_size};
1480+ const std::optional<CAmount> total_bump_fees{pwallet->chain ().calculateCombinedBumpFee (outpoints_spent, fee_rate)};
1481+ CAmount effective_value = total_input_value - fee_from_size - total_bump_fees.value_or (0 );
14741482
14751483 if (fee_from_size > pwallet->m_default_max_tx_fee ) {
14761484 throw JSONRPCError (RPC_WALLET_ERROR, TransactionErrorString (TransactionError::MAX_FEE_EXCEEDED).original );
You can’t perform that action at this time.
0 commit comments