mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-17 05:30:43 +02:00
test: Add missing syncwithvalidationinterfacequeue
This commit is contained in:
parent
9aa8145bc0
commit
faf6f156ff
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user