test: Add missing syncwithvalidationinterfacequeue

This commit is contained in:
MarcoFalke 2020-02-29 04:05:58 +07:00
parent 9aa8145bc0
commit faf6f156ff
No known key found for this signature in database
GPG key ID: CE2B75697E69A548

View file

@ -12,6 +12,7 @@ from test_framework.mininode import P2PInterface, mininode_lock
from test_framework.test_framework import BitcoinTestFramework from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, wait_until from test_framework.util import assert_equal, wait_until
class P2PStoreTxInvs(P2PInterface): class P2PStoreTxInvs(P2PInterface):
def __init__(self): def __init__(self):
super().__init__() super().__init__()
@ -24,6 +25,7 @@ class P2PStoreTxInvs(P2PInterface):
# save txid # save txid
self.tx_invs_received[i.hash] += 1 self.tx_invs_received[i.hash] += 1
class ResendWalletTransactionsTest(BitcoinTestFramework): class ResendWalletTransactionsTest(BitcoinTestFramework):
def set_test_params(self): def set_test_params(self):
self.num_nodes = 1 self.num_nodes = 1
@ -63,6 +65,7 @@ class ResendWalletTransactionsTest(BitcoinTestFramework):
node.submitblock(ToHex(block)) node.submitblock(ToHex(block))
# Transaction should not be rebroadcast # Transaction should not be rebroadcast
node.syncwithvalidationinterfacequeue()
node.p2ps[1].sync_with_ping() node.p2ps[1].sync_with_ping()
assert_equal(node.p2ps[1].tx_invs_received[txid], 0) assert_equal(node.p2ps[1].tx_invs_received[txid], 0)
@ -72,5 +75,6 @@ class ResendWalletTransactionsTest(BitcoinTestFramework):
node.setmocktime(rebroadcast_time) node.setmocktime(rebroadcast_time)
wait_until(lambda: node.p2ps[1].tx_invs_received[txid] >= 1, lock=mininode_lock) wait_until(lambda: node.p2ps[1].tx_invs_received[txid] >= 1, lock=mininode_lock)
if __name__ == '__main__': if __name__ == '__main__':
ResendWalletTransactionsTest().main() ResendWalletTransactionsTest().main()