Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc-sync-chain.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2018 The Bitcoin developers | # Copyright (c) 2018 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. | ||||
""" | """ | ||||
Test that a node receiving many (potentially out of order) blocks exits | Test that a node receiving many (potentially out of order) blocks exits | ||||
initial block download (IBD; this occurs once it has passed minimumchainwork) | initial block download (IBD; this occurs once it has passed minimumchainwork) | ||||
and continues to sync without seizing. | and continues to sync without seizing. | ||||
""" | """ | ||||
import random | import random | ||||
from test_framework.blocktools import create_block, create_coinbase | from test_framework.blocktools import create_block, create_coinbase | ||||
from test_framework.messages import CBlockHeader, msg_block, msg_headers | from test_framework.messages import CBlockHeader, msg_block, msg_headers | ||||
from test_framework.mininode import P2PInterface | from test_framework.p2p import P2PInterface | ||||
from test_framework.test_framework import BitcoinTestFramework | from test_framework.test_framework import BitcoinTestFramework | ||||
from test_framework.util import wait_until | from test_framework.util import wait_until | ||||
NUM_IBD_BLOCKS = 50 | NUM_IBD_BLOCKS = 50 | ||||
class BaseNode(P2PInterface): | class BaseNode(P2PInterface): | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |