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

Function FindAndDelete

test/functional/test_framework/script.py:704–719  ·  view source on GitHub ↗

Consensus critical, see FindAndDelete() in Satoshi codebase

(script, sig)

Source from the content-addressed store, hash-verified

702 return sig
703
704def FindAndDelete(script, sig):
705 """Consensus critical, see FindAndDelete() in Satoshi codebase"""
706 r = b''
707 last_sop_idx = sop_idx = 0
708 skip = True
709 for (opcode, data, sop_idx) in script.raw_iter():
710 if not skip:
711 r += script[last_sop_idx:sop_idx]
712 last_sop_idx = sop_idx
713 if script[sop_idx:sop_idx + len(sig)] == sig:
714 skip = True
715 else:
716 skip = False
717 if not skip:
718 r += script[last_sop_idx:]
719 return CScript(r)
720
721def LegacySignatureMsg(script, txTo, inIdx, hashtype, enable_sighash_rangeproof=True):
722 """Preimage of the signature hash, if it exists.

Callers 1

LegacySignatureMsgFunction · 0.70

Calls 2

CScriptClass · 0.70
raw_iterMethod · 0.45

Tested by

no test coverage detected