Changeset View
Changeset View
Standalone View
Standalone View
test/functional/feature_cltv.py
Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
"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") | ||||
fundtx = create_transaction(self.nodes[0], self.coinbase_txids[0], | fundtx = create_transaction(self.nodes[0], self.coinbase_txids[0], | ||||
self.nodeaddress, 49.99) | self.nodeaddress, 49.99) | ||||
fundtx, spendtx = cltv_lock_to_height( | fundtx, spendtx = cltv_lock_to_height( | ||||
self.nodes[0], fundtx, self.nodeaddress, 49.98) | self.nodes[0], fundtx, self.nodeaddress, 49.98) | ||||
tip = self.nodes[0].getbestblockhash() | tip = self.nodes[0].getbestblockhash() | ||||
block_time = self.nodes[0].getblockheader(tip)['mediantime'] + 1 | block_time = self.nodes[0].getblockheader(tip)['time'] + 1 | ||||
block = create_block(int(tip, 16), create_coinbase( | block = create_block(int(tip, 16), create_coinbase( | ||||
CLTV_HEIGHT - 1), block_time) | CLTV_HEIGHT - 1), block_time) | ||||
block.nVersion = 3 | block.nVersion = 3 | ||||
block.vtx.append(fundtx) | block.vtx.append(fundtx) | ||||
# include the -1 CLTV in block | # include the -1 CLTV in block | ||||
block.vtx.append(spendtx) | block.vtx.append(spendtx) | ||||
make_conform_to_ctor(block) | make_conform_to_ctor(block) | ||||
block.hashMerkleRoot = block.calc_merkle_root() | block.hashMerkleRoot = block.calc_merkle_root() | ||||
▲ Show 20 Lines • Show All 99 Lines • Show Last 20 Lines |