@@ -31,9 +31,6 @@ def set_test_params(self):
31
31
self .setup_clean_chain = True
32
32
self .num_nodes = 1
33
33
34
- def skip_test_if_missing_module (self ):
35
- self .skip_if_no_wallet ()
36
-
37
34
def setup_network (self ):
38
35
self .alert_filename = os .path .join (self .options .tmpdir , "alert.txt" )
39
36
# Open and close to create zero-length file
@@ -68,13 +65,14 @@ def run_test(self):
68
65
node = self .nodes [0 ]
69
66
node .add_p2p_connection (P2PInterface ())
70
67
68
+ node_deterministic_address = node .get_deterministic_priv_key ().address
71
69
# Mine one period worth of blocks
72
- node .generate (VB_PERIOD )
70
+ node .generatetoaddress (VB_PERIOD , node_deterministic_address )
73
71
74
72
self .log .info ("Check that there is no warning if previous VB_BLOCKS have <VB_THRESHOLD blocks with unknown versionbits version." )
75
73
# Build one period of blocks with < VB_THRESHOLD blocks signaling some unknown bit
76
74
self .send_blocks_with_version (node .p2p , VB_THRESHOLD - 1 , VB_UNKNOWN_VERSION )
77
- node .generate (VB_PERIOD - VB_THRESHOLD + 1 )
75
+ node .generatetoaddress (VB_PERIOD - VB_THRESHOLD + 1 , node_deterministic_address )
78
76
79
77
# Check that we're not getting any versionbit-related errors in get*info()
80
78
assert (not VB_PATTERN .match (node .getmininginfo ()["warnings" ]))
@@ -83,7 +81,7 @@ def run_test(self):
83
81
self .log .info ("Check that there is a warning if >50 blocks in the last 100 were an unknown version" )
84
82
# Build one period of blocks with VB_THRESHOLD blocks signaling some unknown bit
85
83
self .send_blocks_with_version (node .p2p , VB_THRESHOLD , VB_UNKNOWN_VERSION )
86
- node .generate (VB_PERIOD - VB_THRESHOLD )
84
+ node .generatetoaddress (VB_PERIOD - VB_THRESHOLD , node_deterministic_address )
87
85
88
86
# Check that get*info() shows the 51/100 unknown block version error.
89
87
assert (WARN_UNKNOWN_RULES_MINED in node .getmininginfo ()["warnings" ])
@@ -92,16 +90,16 @@ def run_test(self):
92
90
self .log .info ("Check that there is a warning if previous VB_BLOCKS have >=VB_THRESHOLD blocks with unknown versionbits version." )
93
91
# Mine a period worth of expected blocks so the generic block-version warning
94
92
# is cleared. This will move the versionbit state to ACTIVE.
95
- node .generate (VB_PERIOD )
93
+ node .generatetoaddress (VB_PERIOD , node_deterministic_address )
96
94
97
95
# Stop-start the node. This is required because bitcoind will only warn once about unknown versions or unknown rules activating.
98
96
self .restart_node (0 )
99
97
100
98
# Generating one block guarantees that we'll get out of IBD
101
- node .generate ( 1 )
99
+ node .generatetoaddress ( 1 , node_deterministic_address )
102
100
wait_until (lambda : not node .getblockchaininfo ()['initialblockdownload' ], timeout = 10 , lock = mininode_lock )
103
101
# Generating one more block will be enough to generate an error.
104
- node .generate ( 1 )
102
+ node .generatetoaddress ( 1 , node_deterministic_address )
105
103
# Check that get*info() shows the versionbits unknown rules warning
106
104
assert (WARN_UNKNOWN_RULES_ACTIVE in node .getmininginfo ()["warnings" ])
107
105
assert (WARN_UNKNOWN_RULES_ACTIVE in node .getnetworkinfo ()["warnings" ])
0 commit comments