Skip to content

Commit 921c61e

Browse files
committed
Merge bitcoin/bitcoin#29973: test: Assumeutxo: ensure failure when importing a snapshot twice
b259b0e [Test] Assumeutxo: ensure failure when importing a snapshot twice (Alfonso Roman Zubeldia) Pull request description: I am getting familiar with the `assume_utxo` tests and I found that the scenario of trying to activate a snapshot twice is not covered. This test is to ensure failure when loading a snapshot if there is already a snapshot-based chainstate. ACKs for top commit: fjahr: Code review ACK b259b0e kevkevinpal: tACK [b259b0e](bitcoin/bitcoin@b259b0e) achow101: ACK b259b0e rkrux: tACK [b259b0e](bitcoin/bitcoin@b259b0e) Tree-SHA512: 3510861390d0e40cdad6861b728df04827a1b63e642f3d956aee66ed2770b1cb7e3aa3eb00c62eb9da0544703c943cc5296936c9ebfcac18c719741c354421bb
2 parents 6f1d906 + b259b0e commit 921c61e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/functional/feature_assumeutxo.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,10 @@ def check_tx_counts(final: bool) -> None:
405405
assert_equal(snapshot['snapshot_blockhash'], dump_output['base_hash'])
406406
assert_equal(snapshot['validated'], False)
407407

408+
self.log.info("Check that loading the snapshot again will fail because there is already an active snapshot.")
409+
with n2.assert_debug_log(expected_msgs=["[snapshot] can't activate a snapshot-based chainstate more than once"]):
410+
assert_raises_rpc_error(-32603, "Unable to load UTXO snapshot", n2.loadtxoutset, dump_output['path'])
411+
408412
self.connect_nodes(0, 2)
409413
self.wait_until(lambda: n2.getchainstates()['chainstates'][-1]['blocks'] == FINAL_HEIGHT)
410414
self.sync_blocks()

0 commit comments

Comments
 (0)