MCPcopy Create free account
hub / github.com/ElementsProject/elements / cltv_modify_tx

Function cltv_modify_tx

test/functional/feature_cltv.py:38–45  ·  view source on GitHub ↗
(tx, prepend_scriptsig, nsequence=None, nlocktime=None)

Source from the content-addressed store, hash-verified

36# 1) prepending a given script to the scriptSig of vin 0 and
37# 2) (optionally) modify the nSequence of vin 0 and the tx's nLockTime
38def cltv_modify_tx(tx, prepend_scriptsig, nsequence=None, nlocktime=None):
39 assert_equal(len(tx.vin), 1)
40 if nsequence is not None:
41 tx.vin[0].nSequence = nsequence
42 tx.nLockTime = nlocktime
43
44 tx.vin[0].scriptSig = CScript(prepend_scriptsig + list(CScript(tx.vin[0].scriptSig)))
45 tx.rehash()
46
47
48def cltv_invalidate(tx, failure_reason):

Callers 2

cltv_invalidateFunction · 0.85
cltv_validateFunction · 0.85

Calls 3

assert_equalFunction · 0.90
CScriptClass · 0.90
rehashMethod · 0.45

Tested by

no test coverage detected