Skip to content

Commit 749b80b

Browse files
committed
Merge bitcoin#25497: wallet: more accurate target for large transactions
25e4762 wallet: more accurate tx_noinputs_size (S3RK) Pull request description: Rationale: more accurate non-input fee estimation for txs with >=253 inputs ACKs for top commit: laanwj: Concept and code review ACK 25e4762 achow101: ACK 25e4762 furszy: Code review ACK 25e4762. left a small nit. Tree-SHA512: bda8fad725d32ad3e13c007fa56ddb6679ac1a32098ddb08d9a114054acfa681cb66cd703ac675297f731cb381b09067a99a4efa31320140bbdd03f0cfdc81af
2 parents cc22bd7 + 25e4762 commit 749b80b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/wallet/spend.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,8 @@ static std::optional<CreatedTransactionResult> CreateTransactionInternal(
760760

761761
// vouts to the payees
762762
if (!coin_selection_params.m_subtract_fee_outputs) {
763-
coin_selection_params.tx_noinputs_size = 11; // Static vsize overhead + outputs vsize. 4 nVersion, 4 nLocktime, 1 input count, 1 output count, 1 witness overhead (dummy, flag, stack size)
763+
coin_selection_params.tx_noinputs_size = 10; // Static vsize overhead + outputs vsize. 4 nVersion, 4 nLocktime, 1 input count, 1 witness overhead (dummy, flag, stack size)
764+
coin_selection_params.tx_noinputs_size += GetSizeOfCompactSize(vecSend.size()); // bytes for output count
764765
}
765766
for (const auto& recipient : vecSend)
766767
{

0 commit comments

Comments
 (0)