Skip to content

Commit 2c517b3

Browse files
committed
Fix p2p-feefilter.py for changed tx relay behavior
1 parent ea26874 commit 2c517b3

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

qa/rpc-tests/p2p-feefilter.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def setup_network(self):
6262

6363
def run_test(self):
6464
node1 = self.nodes[1]
65+
node0 = self.nodes[0]
6566
# Get out of IBD
6667
node1.generate(1)
6768
sync_blocks(self.nodes)
@@ -91,8 +92,17 @@ def run_test(self):
9192
node1.settxfee(Decimal("0.00010000"))
9293
[node1.sendtoaddress(node1.getnewaddress(), 1) for x in range(3)]
9394
sync_mempools(self.nodes) # must be sure node 0 has received all txs
94-
time.sleep(10) # wait 10 secs to be sure its doesn't relay any
95-
assert(allInvsMatch([], test_node))
95+
96+
# Send one transaction from node0 that should be received, so that we
97+
# we can sync the test on receipt (if node1's txs were relayed, they'd
98+
# be received by the time this node0 tx is received). This is
99+
# unfortunately reliant on the current relay behavior where we batch up
100+
# to 35 entries in an inv, which means that when this next transaction
101+
# is eligible for relay, the prior transactions from node1 are eligible
102+
# as well.
103+
node0.settxfee(Decimal("0.00020000"))
104+
txids = [node0.sendtoaddress(node0.getnewaddress(), 1)]
105+
assert(allInvsMatch(txids, test_node))
96106
test_node.clear_invs()
97107

98108
# Remove fee filter and check that txs are received again

0 commit comments

Comments
 (0)