Changeset View
Changeset View
Standalone View
Standalone View
test/functional/feature_cltv.py
Show All 11 Lines | |||||
from test_framework.messages import ( | from test_framework.messages import ( | ||||
CTransaction, | CTransaction, | ||||
FromHex, | FromHex, | ||||
msg_block, | msg_block, | ||||
msg_tx, | msg_tx, | ||||
ToHex, | ToHex, | ||||
) | ) | ||||
from test_framework.mininode import ( | from test_framework.mininode import ( | ||||
network_thread_start, | |||||
P2PInterface, | P2PInterface, | ||||
) | ) | ||||
from test_framework.script import ( | from test_framework.script import ( | ||||
CScript, | CScript, | ||||
CScriptNum, | CScriptNum, | ||||
OP_1NEGATE, | OP_1NEGATE, | ||||
OP_CHECKLOCKTIMEVERIFY, | OP_CHECKLOCKTIMEVERIFY, | ||||
OP_DROP, | OP_DROP, | ||||
▲ Show 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | |||||
class BIP65Test(BitcoinTestFramework): | class BIP65Test(BitcoinTestFramework): | ||||
def set_test_params(self): | def set_test_params(self): | ||||
self.num_nodes = 1 | self.num_nodes = 1 | ||||
self.extra_args = [['-whitelist=127.0.0.1']] | self.extra_args = [['-whitelist=127.0.0.1']] | ||||
self.setup_clean_chain = True | self.setup_clean_chain = True | ||||
def run_test(self): | def run_test(self): | ||||
self.nodes[0].add_p2p_connection(P2PInterface()) | self.nodes[0].add_p2p_connection(P2PInterface()) | ||||
network_thread_start() | |||||
# wait_for_verack ensures that the P2P connection is fully up. | |||||
self.nodes[0].p2p.wait_for_verack() | self.nodes[0].p2p.wait_for_verack() | ||||
self.log.info("Mining {} blocks".format(CLTV_HEIGHT - 2)) | self.log.info("Mining {} blocks".format(CLTV_HEIGHT - 2)) | ||||
self.coinbase_blocks = self.nodes[0].generate(CLTV_HEIGHT - 2) | self.coinbase_blocks = self.nodes[0].generate(CLTV_HEIGHT - 2) | ||||
self.nodeaddress = self.nodes[0].getnewaddress() | self.nodeaddress = self.nodes[0].getnewaddress() | ||||
self.log.info( | self.log.info( | ||||
"Test that an invalid-according-to-CLTV transaction can still appear in a block") | "Test that an invalid-according-to-CLTV transaction can still appear in a block") | ||||
▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines |