Changeset View
Changeset View
Standalone View
Standalone View
test/functional/feature_cltv.py
Show First 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
"Test that invalid-according-to-cltv transactions cannot appear in a block") | "Test that invalid-according-to-cltv transactions cannot appear in a block") | ||||
block.nVersion = 4 | block.nVersion = 4 | ||||
fundtx = create_transaction(self.nodes[0], self.coinbase_txids[1], | fundtx = create_transaction(self.nodes[0], self.coinbase_txids[1], | ||||
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) | ||||
# The funding tx only has unexecuted bad CLTV, in scriptpubkey; this is valid. | # The funding tx only has unexecuted bad CLTV, in scriptpubkey; this is | ||||
# valid. | |||||
self.nodes[0].p2p.send_and_ping(msg_tx(fundtx)) | self.nodes[0].p2p.send_and_ping(msg_tx(fundtx)) | ||||
assert fundtx.hash in self.nodes[0].getrawmempool() | assert fundtx.hash in self.nodes[0].getrawmempool() | ||||
# Mine a block containing the funding transaction | # Mine a block containing the funding transaction | ||||
block.vtx.append(fundtx) | block.vtx.append(fundtx) | ||||
block.hashMerkleRoot = block.calc_merkle_root() | block.hashMerkleRoot = block.calc_merkle_root() | ||||
block.solve() | block.solve() | ||||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |