Changeset View
Changeset View
Standalone View
Standalone View
test/functional/feature_assumevalid.py
Show All 25 Lines | Start three nodes: | ||||
- node1 has -assumevalid set to the hash of block 102. Try to sync to | - node1 has -assumevalid set to the hash of block 102. Try to sync to | ||||
block 2202. node1 will sync all the way to block 2202. | block 2202. node1 will sync all the way to block 2202. | ||||
- node2 has -assumevalid set to the hash of block 102. Try to sync to | - node2 has -assumevalid set to the hash of block 102. Try to sync to | ||||
block 200. node2 will reject block 102 since it's assumed valid, but it | block 200. node2 will reject block 102 since it's assumed valid, but it | ||||
isn't buried by at least two weeks' work. | isn't buried by at least two weeks' work. | ||||
""" | """ | ||||
import time | import time | ||||
from test_framework.blocktools import (create_block, create_coinbase) | from test_framework.blocktools import create_block, create_coinbase | ||||
from test_framework.key import ECKey | from test_framework.key import ECKey | ||||
from test_framework.messages import ( | from test_framework.messages import ( | ||||
CBlockHeader, | CBlockHeader, | ||||
COutPoint, | COutPoint, | ||||
CTransaction, | CTransaction, | ||||
CTxIn, | CTxIn, | ||||
CTxOut, | CTxOut, | ||||
msg_block, | msg_block, | ||||
msg_headers, | msg_headers, | ||||
) | ) | ||||
from test_framework.p2p import P2PInterface | from test_framework.p2p import P2PInterface | ||||
from test_framework.script import (CScript, OP_TRUE) | from test_framework.script import OP_TRUE, CScript | ||||
from test_framework.test_framework import BitcoinTestFramework | 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 | from test_framework.util import assert_equal | ||||
class BaseNode(P2PInterface): | class BaseNode(P2PInterface): | ||||
def send_header_for_blocks(self, new_blocks): | def send_header_for_blocks(self, new_blocks): | ||||
headers_message = msg_headers() | headers_message = msg_headers() | ||||
▲ Show 20 Lines • Show All 155 Lines • Show Last 20 Lines |