mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-05 05:02:06 +02:00
test: replace inv type magic numbers by constants
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
"""Test that we don't leak txs to inbound peers that we haven't yet announced to"""
|
||||
|
||||
from test_framework.messages import msg_getdata, CInv
|
||||
from test_framework.messages import msg_getdata, CInv, MSG_TX
|
||||
from test_framework.mininode import P2PDataStore
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import (
|
||||
@ -37,7 +37,7 @@ class P2PLeakTxTest(BitcoinTestFramework):
|
||||
txid = gen_node.sendtoaddress(gen_node.getnewaddress(), 0.01)
|
||||
|
||||
want_tx = msg_getdata()
|
||||
want_tx.inv.append(CInv(t=1, h=int(txid, 16)))
|
||||
want_tx.inv.append(CInv(t=MSG_TX, h=int(txid, 16)))
|
||||
inbound_peer.last_message.pop('notfound', None)
|
||||
inbound_peer.send_and_ping(want_tx)
|
||||
|
||||
|
Reference in New Issue
Block a user