test: Wait for node exit after crash in verify_utxo_hash
What changed, and why it matters
This is a small fix to a Bitcoin Core test script. The test deliberately crashes nodes to check that the database recovers correctly. The change adds a short wait after detecting a crash before restarting the node, preventing the test from trying to restart a node that has not fully shut down yet. It does not change the actual Bitcoin network software that users run, so it has no direct security impact on real Bitcoin nodes.
No action required for production deployments. Treat as a normal test reliability improvement.
Security signals we found
Test-only change with no effect on production node code
Adds synchronization wait after expected crash in functional test
Prevents premature restart_node call on a still-running process
Evidence from the diff
In test/functional/feature_dbcrash.py, the verify_utxo_hash helper catches exceptions from gettxoutsetinfo (usually caused by a node crash during database flushing) and then calls restart_node. The patch inserts self.wait_for_node_exit(i, timeout=10) before restart_node to ensure the process has terminated. This is a test-hardening change that avoids race conditions in the functional test suite; it does not modify consensus, networking, wallet, or node runtime code.
Changed components
test/functional/feature_dbcrash.pyInspect captured patch +1 / −0
diff --git a/test/functional/feature_dbcrash.py b/test/functional/feature_dbcrash.py
index 693bc50a..24e663af 100755
--- a/test/functional/feature_dbcrash.py
+++ b/test/functional/feature_dbcrash.py
@@ -170,6 +170,7 @@ class ChainstateWriteCrashTest(BitcoinTestFramework):
nodei_utxo_hash = self.nodes[i].gettxoutsetinfo()['hash_serialized_3']
except Exception:
# probably a crash on db flushing
+ self.wait_for_node_exit(i, timeout=10)
nodei_utxo_hash = self.restart_node(i, expected_tip=self.nodes[3].getbestblockhash())
assert_equal(nodei_utxo_hash, node3_utxo_hash)
Why this scored 18/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.