Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_node_network_limited.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2017 The Bitcoin Core developers | # Copyright (c) 2017 The Bitcoin Core 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. | ||||
"""Tests NODE_NETWORK_LIMITED. | """Tests NODE_NETWORK_LIMITED. | ||||
Tests that a node configured with -prune=550 signals NODE_NETWORK_LIMITED correctly | Tests that a node configured with -prune=550 signals NODE_NETWORK_LIMITED correctly | ||||
and that it responds to getdata requests for blocks correctly: | and that it responds to getdata requests for blocks correctly: | ||||
- send a block within 288 + 2 of the tip | - send a block within 288 + 2 of the tip | ||||
- disconnect peers who request blocks older than that.""" | - disconnect peers who request blocks older than that.""" | ||||
from test_framework.messages import ( | from test_framework.messages import ( | ||||
CInv, | |||||
MSG_BLOCK, | MSG_BLOCK, | ||||
msg_getdata, | |||||
msg_verack, | |||||
NODE_BLOOM, | NODE_BLOOM, | ||||
NODE_NETWORK_LIMITED, | NODE_NETWORK_LIMITED, | ||||
CInv, | |||||
msg_getdata, | |||||
msg_verack, | |||||
) | ) | ||||
from test_framework.p2p import ( | from test_framework.p2p import P2PInterface, p2p_lock | ||||
p2p_lock, | |||||
P2PInterface, | |||||
) | |||||
from test_framework.test_framework import BitcoinTestFramework | from test_framework.test_framework import BitcoinTestFramework | ||||
from test_framework.util import ( | from test_framework.util import ( | ||||
assert_equal, | assert_equal, | ||||
connect_nodes, | connect_nodes, | ||||
disconnect_nodes, | disconnect_nodes, | ||||
wait_until, | wait_until, | ||||
) | ) | ||||
▲ Show 20 Lines • Show All 113 Lines • Show Last 20 Lines |