Page MenuHomePhabricator

D16888.diff
No OneTemporary

D16888.diff

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

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)

Event Timeline