Skip to content

Commit

Permalink
Merge #18228: test: Add missing syncwithvalidationinterfacequeue
Browse files Browse the repository at this point in the history
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
  • Loading branch information
MarcoFalke committed Mar 12, 2020
2 parents 2737197 + faf6f15 commit e2d3663
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/functional/wallet_resendwallettransactions.py
Expand Up @@ -12,6 +12,7 @@
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, wait_until


class P2PStoreTxInvs(P2PInterface):
def __init__(self):
super().__init__()
Expand All @@ -24,6 +25,7 @@ def on_inv(self, message):
# save txid
self.tx_invs_received[i.hash] += 1


class ResendWalletTransactionsTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
Expand Down Expand Up @@ -63,6 +65,7 @@ def run_test(self):
node.submitblock(ToHex(block))

# Transaction should not be rebroadcast
node.syncwithvalidationinterfacequeue()
node.p2ps[1].sync_with_ping()
assert_equal(node.p2ps[1].tx_invs_received[txid], 0)

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


if __name__ == '__main__':
ResendWalletTransactionsTest().main()

0 comments on commit e2d3663

Please sign in to comment.