test: Sync mempools after tx creation in rpc_gettxspendingprevout
What changed, and why it matters
This is a one-line change to a Bitcoin Core functional test. It adds a mempool synchronization step before the test checks that transactions are visible across nodes. It does not change production code, consensus rules, networking, or wallet behavior, and it does not fix a security issue in the Bitcoin software itself.
No security action required. This is a routine test reliability improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies test/functional/rpc_gettxspendingprevout.py only. After creating eight transactions and broadcasting them, the test now calls self.sync_mempools() before querying node0.getrawmempool(). This eliminates a race condition in the test harness where assertions about mempool contents could run before all nodes had propagated the transactions. No C++, Python production, or RPC server code is changed.
Changed components
test/functional/rpc_gettxspendingprevout.pyInspect captured patch +1 / −0
diff --git a/test/functional/rpc_gettxspendingprevout.py b/test/functional/rpc_gettxspendingprevout.py
index 04bc4237..ecf42e0a 100755
--- a/test/functional/rpc_gettxspendingprevout.py
+++ b/test/functional/rpc_gettxspendingprevout.py
@@ -76,6 +76,7 @@ class GetTxSpendingPrevoutTest(BitcoinTestFramework):
txs = [txA, txB, txC, txD, txE, txF, txG, txH]
txidA, txidB, txidC, txidD, txidE, txidF, txidG, txidH = [tx["txid"] for tx in txs]
+ self.sync_mempools()
mempool = node0.getrawmempool()
assert_equal(len(mempool), 8)
for tx in txs:
Why this scored 15/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.