Skip to content

Commit fa32e67

Browse files
committed
[test] Manage node connections better in mempool persist test
there were two calls to disconnect_nodes that were no-ops. fixed one & removed the other & added assertions to confirm node has no connections when creating the unbroadcast transaction.
1 parent 1f94bb0 commit fa32e67

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test/functional/mempool_persist.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ def run_test(self):
8484
assert_greater_than_or_equal(tx_creation_time_higher, tx_creation_time)
8585

8686
# disconnect nodes & make a txn that remains in the unbroadcast set.
87-
disconnect_nodes(self.nodes[0], 2)
87+
disconnect_nodes(self.nodes[0], 1)
88+
assert(len(self.nodes[0].getpeerinfo()) == 0)
89+
assert(len(self.nodes[0].p2ps) == 0)
8890
self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), Decimal("12"))
8991
connect_nodes(self.nodes[0], 2)
9092

@@ -157,8 +159,10 @@ def test_persist_unbroadcast(self):
157159
# clear out mempool
158160
node0.generate(1)
159161

160-
# disconnect nodes to make a txn that remains in the unbroadcast set.
161-
disconnect_nodes(node0, 1)
162+
# ensure node0 doesn't have any connections
163+
# make a transaction that will remain in the unbroadcast set
164+
assert(len(node0.getpeerinfo()) == 0)
165+
assert(len(node0.p2ps) == 0)
162166
node0.sendtoaddress(self.nodes[1].getnewaddress(), Decimal("12"))
163167

164168
# shutdown, then startup with wallet disabled

0 commit comments

Comments
 (0)