aboutsummaryrefslogtreecommitdiff
path: root/test/functional/p2p_segwit.py
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2020-07-19 14:47:05 +0700
committerJohn Newbery <john@johnnewbery.com>2020-08-21 15:52:13 +0100
commit9e2897d020b114a10c860f90c5405be029afddba (patch)
tree5ecf24ff3ff76560b935ff8def3b7b3d89a8ce31 /test/functional/p2p_segwit.py
parentd254e6e7951fa81fad06bc82516770a0c186a2fd (diff)
downloadbitcoin-9e2897d020b114a10c860f90c5405be029afddba.tar.xz
scripted-diff: Rename mininode_lock to p2p_lock
-BEGIN VERIFY SCRIPT- sed -i 's/mininode_lock/p2p_lock/g' $(git grep -l "mininode_lock") -END VERIFY SCRIPT-
Diffstat (limited to 'test/functional/p2p_segwit.py')
-rwxr-xr-xtest/functional/p2p_segwit.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/functional/p2p_segwit.py b/test/functional/p2p_segwit.py
index 564e49f3d8..ffb4e6d94b 100755
--- a/test/functional/p2p_segwit.py
+++ b/test/functional/p2p_segwit.py
@@ -44,7 +44,7 @@ from test_framework.messages import (
)
from test_framework.mininode import (
P2PInterface,
- mininode_lock,
+ p2p_lock,
)
from test_framework.script import (
CScript,
@@ -177,7 +177,7 @@ class TestP2PConn(P2PInterface):
if success:
# sanity check
assert (self.wtxidrelay and use_wtxid) or (not self.wtxidrelay and not use_wtxid)
- with mininode_lock:
+ with p2p_lock:
self.last_message.pop("getdata", None)
if use_wtxid:
wtxid = tx.calc_sha256(True)
@@ -195,7 +195,7 @@ class TestP2PConn(P2PInterface):
assert not self.last_message.get("getdata")
def announce_block_and_wait_for_getdata(self, block, use_header, timeout=60):
- with mininode_lock:
+ with p2p_lock:
self.last_message.pop("getdata", None)
self.last_message.pop("getheaders", None)
msg = msg_headers()
@@ -209,7 +209,7 @@ class TestP2PConn(P2PInterface):
self.wait_for_getdata([block.sha256])
def request_block(self, blockhash, inv_type, timeout=60):
- with mininode_lock:
+ with p2p_lock:
self.last_message.pop("block", None)
self.send_message(msg_getdata(inv=[CInv(inv_type, blockhash)]))
self.wait_for_block(blockhash, timeout)
@@ -2114,7 +2114,7 @@ class SegWitTest(BitcoinTestFramework):
# Check wtxidrelay feature negotiation message through connecting a new peer
def received_wtxidrelay():
return (len(self.wtx_node.last_wtxidrelay) > 0)
- wait_until(received_wtxidrelay, timeout=60, lock=mininode_lock)
+ wait_until(received_wtxidrelay, timeout=60, lock=p2p_lock)
# Create a Segwit output from the latest UTXO
# and announce it to the network
@@ -2138,25 +2138,25 @@ class SegWitTest(BitcoinTestFramework):
# Announce Segwit transaction with wtxid
# and wait for getdata
self.wtx_node.announce_tx_and_wait_for_getdata(tx2, use_wtxid=True)
- with mininode_lock:
+ with p2p_lock:
lgd = self.wtx_node.lastgetdata[:]
assert_equal(lgd, [CInv(MSG_WTX, tx2.calc_sha256(True))])
# Announce Segwit transaction from non wtxidrelay peer
# and wait for getdata
self.tx_node.announce_tx_and_wait_for_getdata(tx2, use_wtxid=False)
- with mininode_lock:
+ with p2p_lock:
lgd = self.tx_node.lastgetdata[:]
assert_equal(lgd, [CInv(MSG_TX|MSG_WITNESS_FLAG, tx2.sha256)])
# Send tx2 through; it's an orphan so won't be accepted
- with mininode_lock:
+ with p2p_lock:
self.wtx_node.last_message.pop("getdata", None)
test_transaction_acceptance(self.nodes[0], self.wtx_node, tx2, with_witness=True, accepted=False)
# Expect a request for parent (tx) by txid despite use of WTX peer
self.wtx_node.wait_for_getdata([tx.sha256], 60)
- with mininode_lock:
+ with p2p_lock:
lgd = self.wtx_node.lastgetdata[:]
assert_equal(lgd, [CInv(MSG_TX|MSG_WITNESS_FLAG, tx.sha256)])