mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Merge bitcoin/bitcoin#24649: wallet: do not count wallet utxos as external
7832e9438ftest: fundrawtransaction preset input weight calculation (S3RK)c3981e379fwallet: do not count wallet utxos as external (S3RK) Pull request description: Correctly differentiating between external vs non-external utxos in coin control produces more accurate weight and fee estimations. Weight for external utxos is estimated based on the maximum signature size, while for the wallet utxos we expect minimal signature due to signature grinding. ACKs for top commit: achow101: re-ACK7832e9438fXekyo: re-ACK7832e9438ffurszy: ACK7832e943Tree-SHA512: bb5635b0bd85fa9a76922a53ad3fa062286424c06a695a0e87407c665713e80a33555b644fbb13bcc1ab503dcd7f53aacbdc368d69ac0ecff8005603623ac94f
This commit is contained in:
@@ -699,19 +699,6 @@ void FundTransaction(CWallet& wallet, CMutableTransaction& tx, CAmount& fee_out,
|
||||
setSubtractFeeFromOutputs.insert(pos);
|
||||
}
|
||||
|
||||
// Fetch specified UTXOs from the UTXO set to get the scriptPubKeys and values of the outputs being selected
|
||||
// and to match with the given solving_data. Only used for non-wallet outputs.
|
||||
std::map<COutPoint, Coin> coins;
|
||||
for (const CTxIn& txin : tx.vin) {
|
||||
coins[txin.prevout]; // Create empty map entry keyed by prevout.
|
||||
}
|
||||
wallet.chain().findCoins(coins);
|
||||
for (const auto& coin : coins) {
|
||||
if (!coin.second.out.IsNull()) {
|
||||
coinControl.SelectExternal(coin.first, coin.second.out);
|
||||
}
|
||||
}
|
||||
|
||||
bilingual_str error;
|
||||
|
||||
if (!FundTransaction(wallet, tx, fee_out, change_position, error, lockUnspents, setSubtractFeeFromOutputs, coinControl)) {
|
||||
|
||||
Reference in New Issue
Block a user