Skip to content

Commit eb87963

Browse files
committed
wallet: Try estimating input size with external data if wallet fails
Instead of choosing whether to use the wallet or external data when estimating the size of an input, first use the wallet, then try external data if that failed.
1 parent a537d7a commit eb87963

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/wallet/spend.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,8 +569,12 @@ std::optional<SelectionResult> SelectCoins(const CWallet& wallet, CoinsResult& a
569569
if (!coin_control.GetExternalOutput(outpoint, txout)) {
570570
return std::nullopt;
571571
}
572+
}
573+
574+
if (input_bytes == -1) {
572575
input_bytes = CalculateMaximumSignedInputSize(txout, outpoint, &coin_control.m_external_provider, &coin_control);
573576
}
577+
574578
// If available, override calculated size with coin control specified size
575579
if (coin_control.HasInputWeight(outpoint)) {
576580
input_bytes = GetVirtualTransactionSize(coin_control.GetInputWeight(outpoint), 0, 0);

0 commit comments

Comments
 (0)