bitcoin/test/functional/test_framework
Sebastian Falbesoner d2c4904ef7 test: MiniWallet: more deterministic coin selection for coinbase UTXOs (oldest first)
The coin selection strategy for MiniWallet is quite straight-forward: simply
pick a single UTXO with the largest value:

self._utxos = sorted(self._utxos, key=lambda k: k['value'])
utxo_to_spend = utxo_to_spend or self._utxos.pop()

If there are several candidates with the same value, however, it is not clear
which one is taken.  This can be particularly problematic for coinbase outputs
with fixed block subsidy, since spending could lead to a
'bad-txns-premature-spend-of-coinbase' reject if an UTXO from a too-recent
block is picked.  Introduce block height as second criteria (saved in
self._utxos in the methods generate(...) and rescan_utxos(...)), in order to
avoid potential issues with coinbases that are not matured yet.
2021-10-27 17:49:53 +02:00
..
__init__.py
address.py
authproxy.py
bdb.py
bip340_test_vectors.csv
blocktools.py test: add script_util helper for creating bare multisig scripts 2021-10-26 14:51:18 +02:00
coverage.py
descriptors.py
key.py
messages.py
muhash.py
netutil.py
p2p.py
script.py
script_util.py test: add script_util helper for creating bare multisig scripts 2021-10-26 14:51:18 +02:00
segwit_addr.py
siphash.py
socks5.py
test_framework.py Make explicit the node param in init_wallet() 2021-10-20 00:30:28 -03:00
test_node.py test: Delete generate* calls from TestNode 2021-10-06 13:41:08 +02:00
test_shell.py
util.py Merge bitcoin/bitcoin#23136: test: update fee rate assertion helper in the functional test framework 2021-10-01 10:54:23 +02:00
wallet.py test: MiniWallet: more deterministic coin selection for coinbase UTXOs (oldest first) 2021-10-27 17:49:53 +02:00
wallet_util.py test: add script_util helper for creating bare multisig scripts 2021-10-26 14:51:18 +02:00