Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_sendheaders.py
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | |||||
c. Announce a header that does connect. | c. Announce a header that does connect. | ||||
Expect: no response. | Expect: no response. | ||||
d. Announce 49 headers that don't connect. | d. Announce 49 headers that don't connect. | ||||
Expect: getheaders message each time. | Expect: getheaders message each time. | ||||
e. Announce one more that doesn't connect. | e. Announce one more that doesn't connect. | ||||
Expect: disconnect. | Expect: disconnect. | ||||
""" | """ | ||||
from test_framework.mininode import * | |||||
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 ( | |||||
CBlockHeader, | |||||
CInv, | |||||
msg_block, | |||||
msg_getblocks, | |||||
msg_getdata, | |||||
msg_getheaders, | |||||
msg_headers, | |||||
msg_inv, | |||||
msg_sendheaders, | |||||
) | |||||
from test_framework.mininode import ( | |||||
mininode_lock, | |||||
network_thread_start, | |||||
P2PInterface, | |||||
) | |||||
from test_framework.test_framework import BitcoinTestFramework | |||||
from test_framework.util import assert_equal, sync_blocks, wait_until | |||||
direct_fetch_response_time = 0.05 | direct_fetch_response_time = 0.05 | ||||
class TestNode(P2PInterface): | class TestNode(P2PInterface): | ||||
def __init__(self): | def __init__(self): | ||||
super().__init__() | super().__init__() | ||||
▲ Show 20 Lines • Show All 519 Lines • Show Last 20 Lines |