aboutsummaryrefslogtreecommitdiff
path: root/test/functional/mempool_unbroadcast.py
diff options
context:
space:
mode:
authorElliott Jin <elliott.jin@gmail.com>2020-09-17 00:32:01 -0700
committerElliott Jin <elliott.jin@gmail.com>2020-10-20 00:27:45 -0700
commitbe386840d4a394a1b6221fb7d0fa2b0bc4b1d413 (patch)
treef98ca6eef1e91537f0858b759841bae1b016f75b /test/functional/mempool_unbroadcast.py
parentf5bd46a4cc6d395ce71ecb99852c1774235a249c (diff)
downloadbitcoin-be386840d4a394a1b6221fb7d0fa2b0bc4b1d413.tar.xz
test: Replace use of (dis)?connect_nodes globals
A later scripted-diff commit replaces the majority of uses, which all follow this pattern: (dis)?connect_nodes(self.nodes[a], b) This commit replaces the few "special cases".
Diffstat (limited to 'test/functional/mempool_unbroadcast.py')
-rwxr-xr-xtest/functional/mempool_unbroadcast.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/test/functional/mempool_unbroadcast.py b/test/functional/mempool_unbroadcast.py
index abd5a03d95..b475b65e68 100755
--- a/test/functional/mempool_unbroadcast.py
+++ b/test/functional/mempool_unbroadcast.py
@@ -11,9 +11,7 @@ from test_framework.p2p import P2PTxInvStore
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
- connect_nodes,
create_confirmed_utxos,
- disconnect_nodes,
)
MAX_INITIAL_BROADCAST_DELAY = 15 * 60 # 15 minutes in seconds
@@ -36,7 +34,7 @@ class MempoolUnbroadcastTest(BitcoinTestFramework):
min_relay_fee = node.getnetworkinfo()["relayfee"]
utxos = create_confirmed_utxos(min_relay_fee, node, 10)
- disconnect_nodes(node, 1)
+ self.disconnect_nodes(0, 1)
self.log.info("Generate transactions that only node 0 knows about")
@@ -70,7 +68,7 @@ class MempoolUnbroadcastTest(BitcoinTestFramework):
self.restart_node(0)
self.log.info("Reconnect nodes & check if they are sent to node 1")
- connect_nodes(node, 1)
+ self.connect_nodes(0, 1)
# fast forward into the future & ensure that the second node has the txns
node.mockscheduler(MAX_INITIAL_BROADCAST_DELAY)
@@ -91,7 +89,7 @@ class MempoolUnbroadcastTest(BitcoinTestFramework):
time.sleep(2) # allow sufficient time for possibility of broadcast
assert_equal(len(conn.get_invs()), 0)
- disconnect_nodes(node, 1)
+ self.disconnect_nodes(0, 1)
node.disconnect_p2ps()
def test_txn_removal(self):