MCPcopy Index your code
hub / github.com/btcsuite/btcd / finalOpcodeData

Function finalOpcodeData

txscript/script.go:392–407  ·  view source on GitHub ↗

finalOpcodeData returns the data associated with the final opcode in the script. It will return nil if the script fails to parse.

(scriptVersion uint16, script []byte)

Source from the content-addressed store, hash-verified

390// finalOpcodeData returns the data associated with the final opcode in the
391// script. It will return nil if the script fails to parse.
392func finalOpcodeData(scriptVersion uint16, script []byte) []byte {
393 // Avoid unnecessary work.
394 if len(script) == 0 {
395 return nil
396 }
397
398 var data []byte
399 tokenizer := MakeScriptTokenizer(scriptVersion, script)
400 for tokenizer.Next() {
401 data = tokenizer.Data()
402 }
403 if tokenizer.Err() != nil {
404 return nil
405 }
406 return data
407}
408
409// GetPreciseSigOpCount returns the number of signature operations in
410// scriptPubKey. If bip16 is true then scriptSig may be searched for the

Callers 7

buildWitnessProgramMethod · 0.85
mergeScriptsFunction · 0.85
GetPreciseSigOpCountFunction · 0.85
GetWitnessSigOpCountFunction · 0.85
IsMultisigSigScriptFunction · 0.85
calcP2SHScriptInfoFunction · 0.85

Calls 4

MakeScriptTokenizerFunction · 0.85
DataMethod · 0.80
ErrMethod · 0.80
NextMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…