@@ -45,7 +45,6 @@ def cltv_modify_tx(tx, prepend_scriptsig, nsequence=None, nlocktime=None):
45
45
46
46
tx .vin [0 ].scriptSig = CScript (prepend_scriptsig + list (CScript (tx .vin [0 ].scriptSig )))
47
47
tx .rehash ()
48
- return tx
49
48
50
49
51
50
def cltv_invalidate (tx , failure_reason ):
@@ -69,14 +68,14 @@ def cltv_invalidate(tx, failure_reason):
69
68
[[CScriptNum (500 ), OP_CHECKLOCKTIMEVERIFY , OP_DROP ], 0xffffffff , 500 ],
70
69
][failure_reason ]
71
70
72
- return cltv_modify_tx (tx , prepend_scriptsig = scheme [0 ], nsequence = scheme [1 ], nlocktime = scheme [2 ])
71
+ cltv_modify_tx (tx , prepend_scriptsig = scheme [0 ], nsequence = scheme [1 ], nlocktime = scheme [2 ])
73
72
74
73
75
74
def cltv_validate (tx , height ):
76
75
# Modify the signature in vin 0 and nSequence/nLockTime of the tx to pass CLTV
77
76
scheme = [[CScriptNum (height ), OP_CHECKLOCKTIMEVERIFY , OP_DROP ], 0 , height ]
78
77
79
- return cltv_modify_tx (tx , prepend_scriptsig = scheme [0 ], nsequence = scheme [1 ], nlocktime = scheme [2 ])
78
+ cltv_modify_tx (tx , prepend_scriptsig = scheme [0 ], nsequence = scheme [1 ], nlocktime = scheme [2 ])
80
79
81
80
82
81
class BIP65Test (BitcoinTestFramework ):
@@ -114,7 +113,7 @@ def run_test(self):
114
113
invalid_cltv_txs = []
115
114
for i in range (5 ):
116
115
spendtx = wallet .create_self_transfer (from_node = self .nodes [0 ])['tx' ]
117
- spendtx = cltv_invalidate (spendtx , i )
116
+ cltv_invalidate (spendtx , i )
118
117
invalid_cltv_txs .append (spendtx )
119
118
120
119
tip = self .nodes [0 ].getbestblockhash ()
@@ -149,7 +148,7 @@ def run_test(self):
149
148
# create and test one invalid tx per CLTV failure reason (5 in total)
150
149
for i in range (5 ):
151
150
spendtx = wallet .create_self_transfer (from_node = self .nodes [0 ])['tx' ]
152
- spendtx = cltv_invalidate (spendtx , i )
151
+ cltv_invalidate (spendtx , i )
153
152
154
153
expected_cltv_reject_reason = [
155
154
"non-mandatory-script-verify-flag (Operation not valid with the current stack size)" ,
@@ -182,7 +181,7 @@ def run_test(self):
182
181
peer .sync_with_ping ()
183
182
184
183
self .log .info ("Test that a version 4 block with a valid-according-to-CLTV transaction is accepted" )
185
- spendtx = cltv_validate (spendtx , CLTV_HEIGHT - 1 )
184
+ cltv_validate (spendtx , CLTV_HEIGHT - 1 )
186
185
187
186
block .vtx .pop (1 )
188
187
block .vtx .append (spendtx )
0 commit comments