0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-08 10:31:50 -05:00

test: use CInv::MSG_WITNESS_TX flag in p2p_segwit

This commit is contained in:
Jon Atack 2020-08-08 13:22:19 +02:00
parent 24ee4f01ea
commit aa3621385e
No known key found for this signature in database
GPG key ID: 4F5721B3D0E3921D
2 changed files with 3 additions and 1 deletions

View file

@ -25,6 +25,7 @@ from test_framework.messages import (
MSG_BLOCK, MSG_BLOCK,
MSG_TX, MSG_TX,
MSG_WITNESS_FLAG, MSG_WITNESS_FLAG,
MSG_WITNESS_TX,
MSG_WTX, MSG_WTX,
NODE_NETWORK, NODE_NETWORK,
NODE_WITNESS, NODE_WITNESS,
@ -2158,7 +2159,7 @@ class SegWitTest(BitcoinTestFramework):
self.wtx_node.wait_for_getdata([tx.sha256], 60) self.wtx_node.wait_for_getdata([tx.sha256], 60)
with mininode_lock: with mininode_lock:
lgd = self.wtx_node.lastgetdata[:] lgd = self.wtx_node.lastgetdata[:]
assert_equal(lgd, [CInv(MSG_TX|MSG_WITNESS_FLAG, tx.sha256)]) assert_equal(lgd, [CInv(MSG_WITNESS_TX, tx.sha256)])
# Send tx through # Send tx through
test_transaction_acceptance(self.nodes[0], self.wtx_node, tx, with_witness=False, accepted=True) test_transaction_acceptance(self.nodes[0], self.wtx_node, tx, with_witness=False, accepted=True)

View file

@ -63,6 +63,7 @@ MSG_CMPCT_BLOCK = 4
MSG_WTX = 5 MSG_WTX = 5
MSG_WITNESS_FLAG = 1 << 30 MSG_WITNESS_FLAG = 1 << 30
MSG_TYPE_MASK = 0xffffffff >> 2 MSG_TYPE_MASK = 0xffffffff >> 2
MSG_WITNESS_TX = MSG_TX | MSG_WITNESS_FLAG
FILTER_TYPE_BASIC = 0 FILTER_TYPE_BASIC = 0