Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_invalid_block.py
#!/usr/bin/env python3 | #!/usr/bin/env python3 | ||||
# Copyright (c) 2015-2016 The Bitcoin Core developers | # Copyright (c) 2015-2016 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. | ||||
from test_framework.test_framework import ComparisonTestFramework | |||||
from test_framework.util import * | |||||
from test_framework.comptool import TestManager, TestInstance, RejectResult | |||||
from test_framework.blocktools import * | |||||
from test_framework.mininode import network_thread_start | |||||
import copy | import copy | ||||
import time | import time | ||||
from test_framework.blocktools import ( | |||||
create_block, | |||||
create_coinbase, | |||||
create_transaction, | |||||
) | |||||
from test_framework.comptool import RejectResult, TestInstance, TestManager | |||||
from test_framework.messages import COIN | |||||
from test_framework.mininode import network_thread_start | |||||
from test_framework.test_framework import ComparisonTestFramework | |||||
from test_framework.util import assert_equal | |||||
''' | ''' | ||||
In this test we connect to one node over p2p, and test block requests: | In this test we connect to one node over p2p, and test block requests: | ||||
1) Valid blocks should be requested and become chain tip. | 1) Valid blocks should be requested and become chain tip. | ||||
2) Invalid block with duplicated transaction should be re-requested. | 2) Invalid block with duplicated transaction should be re-requested. | ||||
3) Invalid block with bad coinbase value should be rejected and not | 3) Invalid block with bad coinbase value should be rejected and not | ||||
re-requested. | re-requested. | ||||
''' | ''' | ||||
▲ Show 20 Lines • Show All 123 Lines • Show Last 20 Lines |