Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13711382
D16888.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D16888.diff
View Options
diff --git a/test/functional/mempool_persist.py b/test/functional/mempool_persist.py
--- a/test/functional/mempool_persist.py
+++ b/test/functional/mempool_persist.py
@@ -207,6 +207,7 @@
def test_persist_unbroadcast(self):
node0 = self.nodes[0]
self.start_node(0)
+ self.start_node(2)
# clear out mempool
self.generate(node0, 1, sync_fun=self.no_op)
diff --git a/test/functional/test_framework/wallet.py b/test/functional/test_framework/wallet.py
--- a/test/functional/test_framework/wallet.py
+++ b/test/functional/test_framework/wallet.py
@@ -217,11 +217,19 @@
"""
# Put the largest utxo last
self._utxos = sorted(self._utxos, key=lambda k: (k["value"], -k["height"]))
+ blocks_height = self._test_node.getblockchaininfo()["blocks"]
+ mature_coins = list(
+ filter(
+ lambda utxo: not utxo["coinbase"]
+ or COINBASE_MATURITY - 1 <= blocks_height - utxo["height"],
+ self._utxos,
+ )
+ )
if txid:
utxo_filter: Any = filter(lambda utxo: txid == utxo["txid"], self._utxos)
else:
# By default the largest utxo
- utxo_filter = reversed(self._utxos)
+ utxo_filter = reversed(mature_coins)
if vout is not None:
utxo_filter = filter(lambda utxo: vout == utxo["vout"], utxo_filter)
if confirmed_only:
@@ -242,9 +250,10 @@
):
"""Returns the list of all utxos and optionally mark them as spent"""
if not include_immature_coinbase:
+ blocks_height = self._test_node.getblockchaininfo()["blocks"]
utxo_filter = filter(
lambda utxo: not utxo["coinbase"]
- or COINBASE_MATURITY <= utxo["confirmations"],
+ or COINBASE_MATURITY - 1 <= blocks_height - utxo["height"],
self._utxos,
)
else:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 26, 11:49 (2 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5573453
Default Alt Text
D16888.diff (1 KB)
Attached To
D16888: Merge bitcoin/bitcoin#27177: test: fix intermittent issue in `feature_bip68_sequence`
Event Timeline
Log In to Comment