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()
1467
1467
}
1468
1468
}
1469
1469
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
+
1470
1477
// estimate final size of tx
1471
1478
const TxSize tx_size{CalculateMaximumSignedTxSize (CTransaction (rawTx), pwallet.get ())};
1472
1479
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 );
1474
1482
1475
1483
if (fee_from_size > pwallet->m_default_max_tx_fee ) {
1476
1484
throw JSONRPCError (RPC_WALLET_ERROR, TransactionErrorString (TransactionError::MAX_FEE_EXCEEDED).original );
You can’t perform that action at this time.
0 commit comments