mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-26 05:48:20 +01:00
Merge bitcoin/bitcoin#17526: Add Single Random Draw as an additional coin selection algorithm
3633b667ffUse SelectCoinsSRD if it has less waste (Andrew Chow)8bf789b4b4Add SelectCoinsSRD function (Andrew Chow)2ad3b5d2adtests: wallet_basic lock needed unspents (Andrew Chow)b77885f13etests: wallet_txn explicilty specify inputs (Andrew Chow)59ba7d2861tests: rpc_fundrawtx better test for UTXO inclusion with include_unsafe (Andrew Chow)a165bfbe44tests: rpc_fundrawtx use specific inputs for unavailable change test (Andrew Chow)df765a484dtests: rpc_fundrawtx lock to UTXO types (Andrew Chow) Pull request description: To ease in the use of SRD as our fallback mechanism, this PR adds it as a secondary fallback algorithm in addition to the knapsack solver. Since #22009, the solution with the least waste will be chosen. This pattern is continued with SRD simply being another solution whose waste is compared. ACKs for top commit: glozow: reACK3633b66via `git range-diff 981b9d1...3633b66`, thanks for taking the suggestions laanwj: Concept and code review ACK3633b667ffTree-SHA512: 895659f553fea2230990136565bdf18b1328de8b0ce47f06b64bb4d69301f6dd68cb38debe5c24fb6de1317b735fc020a987c541f00bbea65229de47e53adf92
This commit is contained in:
@@ -13,6 +13,7 @@ from test_framework.util import (
|
||||
assert_equal,
|
||||
assert_fee_amount,
|
||||
assert_raises_rpc_error,
|
||||
find_vout_for_address,
|
||||
)
|
||||
from test_framework.wallet_util import test_address
|
||||
|
||||
@@ -463,6 +464,9 @@ class WalletTest(BitcoinTestFramework):
|
||||
# 1. Send some coins to generate new UTXO
|
||||
address_to_import = self.nodes[2].getnewaddress()
|
||||
txid = self.nodes[0].sendtoaddress(address_to_import, 1)
|
||||
self.sync_mempools(self.nodes[0:3])
|
||||
vout = find_vout_for_address(self.nodes[2], txid, address_to_import)
|
||||
self.nodes[2].lockunspent(False, [{"txid": txid, "vout": vout}])
|
||||
self.generate(self.nodes[0], 1)
|
||||
self.sync_all(self.nodes[0:3])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user