Skip to content

Commit e2d3663

Browse files
author
MarcoFalke
committed
Merge #18228: test: Add missing syncwithvalidationinterfacequeue
faf6f15 test: Add missing syncwithvalidationinterfacequeue (MarcoFalke) Pull request description: The wallet rebroadcast functionality learns about new blocks via the validation interface queue. To avoid test failures such as https://ci.appveyor.com/project/DrahtBot/bitcoin/builds/31119387#L466 , we can sync with the queue before advancing the test. ACKs for top commit: jonatack: ACK faf6f15 this makes sense; the fix was previously added to mempool_persist.py and wallet_zapwallettxes.py in #12217 and to wallet_balance.py in #16302. It is also used in src/test/validation_block_tests.cpp (processnewblock_signals_ordering) and src/bench/wallet_balance.cpp. Tree-SHA512: d72fd4b597b669d8111007902b523e946712913cd6eea6f9a695b0f04ecbe2321d05019873af999a95b9e0aa0f5c140a17109b37503723e40c9eab24ec358eb7
2 parents 2737197 + faf6f15 commit e2d3663

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/functional/wallet_resendwallettransactions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from test_framework.test_framework import BitcoinTestFramework
1313
from test_framework.util import assert_equal, wait_until
1414

15+
1516
class P2PStoreTxInvs(P2PInterface):
1617
def __init__(self):
1718
super().__init__()
@@ -24,6 +25,7 @@ def on_inv(self, message):
2425
# save txid
2526
self.tx_invs_received[i.hash] += 1
2627

28+
2729
class ResendWalletTransactionsTest(BitcoinTestFramework):
2830
def set_test_params(self):
2931
self.num_nodes = 1
@@ -63,6 +65,7 @@ def run_test(self):
6365
node.submitblock(ToHex(block))
6466

6567
# Transaction should not be rebroadcast
68+
node.syncwithvalidationinterfacequeue()
6669
node.p2ps[1].sync_with_ping()
6770
assert_equal(node.p2ps[1].tx_invs_received[txid], 0)
6871

@@ -72,5 +75,6 @@ def run_test(self):
7275
node.setmocktime(rebroadcast_time)
7376
wait_until(lambda: node.p2ps[1].tx_invs_received[txid] >= 1, lock=mininode_lock)
7477

78+
7579
if __name__ == '__main__':
7680
ResendWalletTransactionsTest().main()

0 commit comments

Comments
 (0)