Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_compactblocks.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2016 The Bitcoin Core developers | # Copyright (c) 2016 The Bitcoin Core developers | ||||
# Copyright (c) 2017 The Bitcoin developers | # Copyright (c) 2017 The Bitcoin developers | ||||
# Distributed under the MIT software license, see the accompanying | # Distributed under the MIT software license, see the accompanying | ||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | # file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
from test_framework.mininode import * | import random | ||||
from test_framework.test_framework import BitcoinTestFramework | |||||
from test_framework.util import * | |||||
from test_framework.blocktools import create_block, create_coinbase | from test_framework.blocktools import create_block, create_coinbase | ||||
from test_framework.messages import ( | |||||
BlockTransactions, | |||||
BlockTransactionsRequest, | |||||
calculate_shortid, | |||||
CBlock, | |||||
CBlockHeader, | |||||
CInv, | |||||
COutPoint, | |||||
CTransaction, | |||||
CTxIn, | |||||
CTxOut, | |||||
FromHex, | |||||
HeaderAndShortIDs, | |||||
msg_block, | |||||
msg_blocktxn, | |||||
msg_cmpctblock, | |||||
msg_getblocktxn, | |||||
msg_getdata, | |||||
msg_getheaders, | |||||
msg_headers, | |||||
msg_inv, | |||||
msg_sendcmpct, | |||||
msg_sendheaders, | |||||
msg_tx, | |||||
NODE_NETWORK, | |||||
P2PHeaderAndShortIDs, | |||||
PrefilledTransaction, | |||||
ToHex, | |||||
) | |||||
from test_framework.mininode import ( | |||||
mininode_lock, | |||||
network_thread_start, | |||||
P2PInterface, | |||||
) | |||||
from test_framework.script import CScript, OP_TRUE | from test_framework.script import CScript, OP_TRUE | ||||
from test_framework.test_framework import BitcoinTestFramework | |||||
from test_framework.txtools import pad_tx | from test_framework.txtools import pad_tx | ||||
from test_framework.util import assert_equal, sync_blocks, wait_until | |||||
''' | ''' | ||||
CompactBlocksTest -- test compact blocks (BIP 152) | CompactBlocksTest -- test compact blocks (BIP 152) | ||||
Only testing Version 1 compact blocks (txids) | Only testing Version 1 compact blocks (txids) | ||||
''' | ''' | ||||
# TestNode: A peer we use to send messages to bitcoind, and store responses. | # TestNode: A peer we use to send messages to bitcoind, and store responses. | ||||
▲ Show 20 Lines • Show All 879 Lines • Show Last 20 Lines |