From 25e4762ae7a09906020e62cd947e9f71300439cf Mon Sep 17 00:00:00 2001 From: S3RK <1466284+S3RK@users.noreply.github.com> Date: Mon, 4 Apr 2022 09:47:58 +0200 Subject: wallet: more accurate tx_noinputs_size --- src/wallet/spend.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/wallet/spend.cpp b/src/wallet/spend.cpp index 5799a9ff2a..81055a5a1a 100644 --- a/src/wallet/spend.cpp +++ b/src/wallet/spend.cpp @@ -760,7 +760,8 @@ static std::optional CreateTransactionInternal( // vouts to the payees if (!coin_selection_params.m_subtract_fee_outputs) { - 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) + 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) + coin_selection_params.tx_noinputs_size += GetSizeOfCompactSize(vecSend.size()); // bytes for output count } for (const auto& recipient : vecSend) { -- cgit v1.2.3