MCPcopy Create free account
hub / github.com/btcsuite/btcd / ScriptHasOpSuccess

Function ScriptHasOpSuccess

txscript/script.go:551–565  ·  view source on GitHub ↗

ScriptHasOpSuccess returns true if any op codes in the script contain an OP_SUCCESS op code.

(witnessScript []byte)

Source from the content-addressed store, hash-verified

549// ScriptHasOpSuccess returns true if any op codes in the script contain an
550// OP_SUCCESS op code.
551func ScriptHasOpSuccess(witnessScript []byte) bool {
552 // First, create a new script tokenizer so we can run through all the
553 // elements.
554 tokenizer := MakeScriptTokenizer(0, witnessScript)
555
556 // Run through all the op codes, returning true if we find anything
557 // that is marked as a new op success.
558 for tokenizer.Next() {
559 if _, ok := successOpcodes[tokenizer.Opcode()]; ok {
560 return true
561 }
562 }
563
564 return false
565}

Callers 1

verifyWitnessProgramMethod · 0.85

Calls 3

MakeScriptTokenizerFunction · 0.85
OpcodeMethod · 0.80
NextMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…