Changeset View
Changeset View
Standalone View
Standalone View
test/functional/feature_cltv.py
Show First 20 Lines • Show All 155 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
self.nodes[0].p2p.send_and_ping(msg_block(block)) | self.nodes[0].p2p.send_and_ping(msg_block(block)) | ||||
# This block is valid | # This block is valid | ||||
assert_equal(self.nodes[0].getbestblockhash(), block.hash) | assert_equal(self.nodes[0].getbestblockhash(), block.hash) | ||||
# We show that this tx is invalid due to CLTV by getting it | # We show that this tx is invalid due to CLTV by getting it | ||||
# rejected from the mempool for exactly that reason. | # rejected from the mempool for exactly that reason. | ||||
assert_equal( | assert_equal( | ||||
[{'txid': spendtx.hash, 'allowed': False, | [{'txid': spendtx.hash, 'allowed': False, | ||||
'reject-reason': '64: non-mandatory-script-verify-flag (Negative locktime)'}], | 'reject-reason': 'non-mandatory-script-verify-flag (Negative locktime)'}], | ||||
self.nodes[0].testmempoolaccept( | self.nodes[0].testmempoolaccept( | ||||
rawtxs=[spendtx.serialize().hex()], maxfeerate=0) | rawtxs=[spendtx.serialize().hex()], maxfeerate=0) | ||||
) | ) | ||||
rejectedtx_signed = self.nodes[0].signrawtransactionwithwallet( | rejectedtx_signed = self.nodes[0].signrawtransactionwithwallet( | ||||
ToHex(spendtx)) | ToHex(spendtx)) | ||||
# Couldn't complete signature due to CLTV | # Couldn't complete signature due to CLTV | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |