mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 18:53:23 -03:00
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.
This commit is contained in:
parent
a537d7aaa0
commit
eb879634db
1 changed files with 4 additions and 0 deletions
|
@ -569,8 +569,12 @@ std::optional<SelectionResult> SelectCoins(const CWallet& wallet, CoinsResult& a
|
|||
if (!coin_control.GetExternalOutput(outpoint, txout)) {
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
if (input_bytes == -1) {
|
||||
input_bytes = CalculateMaximumSignedInputSize(txout, outpoint, &coin_control.m_external_provider, &coin_control);
|
||||
}
|
||||
|
||||
// If available, override calculated size with coin control specified size
|
||||
if (coin_control.HasInputWeight(outpoint)) {
|
||||
input_bytes = GetVirtualTransactionSize(coin_control.GetInputWeight(outpoint), 0, 0);
|
||||
|
|
Loading…
Add table
Reference in a new issue