Fixes #26071
test: Fix syncwithvalidationinterfacequeue calls #26091
pull MarcoFalke wants to merge 2 commits into bitcoin:master from MarcoFalke:2209-test-fix-🔻 changing 2 files +7 −3-
MarcoFalke commented at 2:42 PM on September 14, 2022: member
-
faa4916529
test/doc: Remove unused syncwithvalidationinterfacequeue
See https://github.com/bitcoin/bitcoin/pull/25768#discussion_r958562071 Also fix doc typo from https://github.com/bitcoin/bitcoin/pull/25768#discussion_r958571943
- fanquake added the label Tests on Sep 14, 2022
-
test: Add missing syncwithvalidationinterfacequeue fa1ce96184
- MarcoFalke force-pushed on Sep 15, 2022
-
MarcoFalke commented at 7:13 AM on September 15, 2022: member
Diff to trigger the bug more often:
diff --git a/src/validationinterface.cpp b/src/validationinterface.cpp index 613c5b65ef..17c135e7ea 100644 --- a/src/validationinterface.cpp +++ b/src/validationinterface.cpp @@ -204,6 +204,7 @@ void CMainSignals::UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockInd void CMainSignals::TransactionAddedToMempool(const CTransactionRef& tx, uint64_t mempool_sequence) { auto event = [tx, mempool_sequence, this] { + UninterruptibleSleep(10ms); m_internals->Iterate([&](CValidationInterface& callbacks) { callbacks.TransactionAddedToMempool(tx, mempool_sequence); }); }; ENQUEUE_AND_LOG_EVENT(event, "%s: txid=%s wtxid=%s", __func__, diff --git a/test/functional/wallet_resendwallettransactions.py b/test/functional/wallet_resendwallettransactions.py index 26df0841d8..0b8f4bf317 100755 --- a/test/functional/wallet_resendwallettransactions.py +++ b/test/functional/wallet_resendwallettransactions.py @@ -86,6 +86,7 @@ class ResendWalletTransactionsTest(BitcoinTestFramework): child_txid = node.send(outputs=[{addr: 0.5}], options={"inputs": [{"txid":txid, "vout":0}]})["txid"] while True: txids = node.listreceivedbyaddress(minconf=0, address_filter=addr)[0]["txids"] + assert_equal(len(txids), 2) if txids == [child_txid, txid]: break bumped = node.bumpfee(child_txid) -
in test/functional/wallet_resendwallettransactions.py:97 in fa1ce96184
88 | @@ -89,6 +89,10 @@ def run_test(self): 89 | if txids == [child_txid, txid]: 90 | break 91 | bumped = node.bumpfee(child_txid) 92 | + # The scheduler queue creates a copy of the added tx after 93 | + # send/bumpfee and re-adds it to the wallet (undoing the next 94 | + # removeprunedfunds). So empty the scheduler queue: 95 | + node.syncwithvalidationinterfacequeue() 96 | node.removeprunedfunds(child_txid) 97 | child_txid = bumped["txid"]
glozow commented at 10:46 AM on September 15, 2022:Note to self/reviewer, I think this is why this fix works
Without this, the ordering may be:
- child1 is created. Added(child1) event is added to queue
- child2 is created using bumpfee. Removed(child1) and Added(child2) events added to queue
- removeprunedfunds(child1) deletes child1 from wallet
wallet.transactionAddedToMempool(child1)actually executes, re-adding child1 to wallet. bug.
And now the ordering must be:
- child1 is created. Added(child1) event is added to queue
wallet.transactionAddedToMempool(child1)executes- child2 is created using bumpfee. Removed(child1) and Added(child2) events added to queue
wallet.transactionAddedToMempool(child2)executes,wallet.transactionRemovedFromMempool(child1)executes.- removeprunedfunds(child1) deletes child1 from wallet
glozow commented at 10:51 AM on September 15, 2022: memberACK fa1ce96184a1815f453e64e14d77cb0025800be9
w0xlt approvedw0xlt commented at 12:34 PM on September 15, 2022: contributorfanquake added this to the milestone 24.0 on Sep 15, 2022fanquake requested review from achow101 on Sep 15, 2022achow101 commented at 5:16 PM on September 15, 2022: memberACK fa1ce96184a1815f453e64e14d77cb0025800be9
achow101 merged this on Sep 15, 2022achow101 closed this on Sep 15, 2022MarcoFalke deleted the branch on Sep 15, 2022sidhujag referenced this in commit d0a9bea5af on Sep 15, 2022bitcoin locked this on Sep 15, 2023ContributorsLabelsMilestone
24.0
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:13 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:13 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me