Skip to content

Commit 4485d3c

Browse files
committed
Merge 40310f5 into merged_master (Bitcoin PR bitcoin/bitcoin#21792)
2 parents a836276 + 40310f5 commit 4485d3c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

test/functional/p2p_segwit.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2030,9 +2030,10 @@ def test_upgrade_after_activation(self):
20302030
# Restarting node 2 should result in a shutdown because the blockchain consists of
20312031
# insufficiently validated blocks per segwit consensus rules.
20322032
self.stop_node(2)
2033-
with self.nodes[2].assert_debug_log(expected_msgs=[
2034-
f"Witness data for blocks after height {SEGWIT_HEIGHT} requires validation. Please restart with -reindex."], timeout=10):
2035-
self.nodes[2].start([f"-segwitheight={SEGWIT_HEIGHT}"])
2033+
self.nodes[2].assert_start_raises_init_error(
2034+
extra_args=[f"-segwitheight={SEGWIT_HEIGHT}"],
2035+
expected_msg=f": Witness data for blocks after height {SEGWIT_HEIGHT} requires validation. Please restart with -reindex..\nPlease restart with -reindex or -reindex-chainstate to recover.",
2036+
)
20362037

20372038
# As directed, the user restarts the node with -reindex
20382039
self.start_node(2, extra_args=["-reindex", f"-segwitheight={SEGWIT_HEIGHT}"])

test/functional/test_framework/test_node.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ def assert_start_raises_init_error(self, extra_args=None, expected_msg=None, mat
505505
self.start(extra_args, stdout=log_stdout, stderr=log_stderr, *args, **kwargs)
506506
ret = self.process.wait(timeout=self.rpc_timeout)
507507
self.log.debug(self._node_msg(f'bitcoind exited with status {ret} during initialization'))
508+
assert ret != 0 # Exit code must indicate failure
508509
self.running = False
509510
self.process = None
510511
# Check stderr for expected message

0 commit comments

Comments
 (0)