Skip to content

Commit fa4d8f3

Browse files
author
MarcoFalke
committed
test: Cache 25 mature coins for ADDRESS_BCRT1_P2WSH_OP_TRUE
1 parent fad2515 commit fa4d8f3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/functional/test_framework/test_framework.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import time
2020

2121
from typing import List
22+
from .address import ADDRESS_BCRT1_P2WSH_OP_TRUE
2223
from .authproxy import JSONRPCException
2324
from . import coverage
2425
from .p2p import NetworkThread
@@ -732,16 +733,17 @@ def _initialize_chain(self):
732733
# Set a time in the past, so that blocks don't end up in the future
733734
cache_node.setmocktime(cache_node.getblockheader(cache_node.getbestblockhash())['time'])
734735

735-
# Create a 199-block-long chain; each of the 4 first nodes
736+
# Create a 199-block-long chain; each of the 3 first nodes
736737
# gets 25 mature blocks and 25 immature.
737-
# The 4th node gets only 24 immature blocks so that the very last
738+
# The 4th address gets 25 mature and only 24 immature blocks so that the very last
738739
# block in the cache does not age too much (have an old tip age).
739740
# This is needed so that we are out of IBD when the test starts,
740741
# see the tip age check in IsInitialBlockDownload().
742+
gen_addresses = [k.address for k in TestNode.PRIV_KEYS] + [ADDRESS_BCRT1_P2WSH_OP_TRUE]
741743
for i in range(8):
742744
cache_node.generatetoaddress(
743745
nblocks=25 if i != 7 else 24,
744-
address=TestNode.PRIV_KEYS[i % 4].address,
746+
address=gen_addresses[i % 4],
745747
)
746748

747749
assert_equal(cache_node.getblockchaininfo()["blocks"], 199)

0 commit comments

Comments
 (0)