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

Function opcodeCodeSeparator

txscript/opcode.go:1953–1961  ·  view source on GitHub ↗

opcodeCodeSeparator stores the current script offset as the most recently seen OP_CODESEPARATOR which is used during signature checking. This opcode does not change the contents of the data stack. The non-segwit ScriptVerifyConstScriptCode rejection is enforced in executeOpcode before this handler

(op *opcode, data []byte, vm *Engine)

Source from the content-addressed store, hash-verified

1951// executeOpcode before this handler is dispatched, so it is not
1952// re-checked here.
1953func opcodeCodeSeparator(op *opcode, data []byte, vm *Engine) error {
1954 vm.lastCodeSep = int(vm.tokenizer.ByteIndex())
1955
1956 if vm.taprootCtx != nil {
1957 vm.taprootCtx.codeSepPos = uint32(vm.tokenizer.OpcodePosition())
1958 }
1959
1960 return nil
1961}
1962
1963// opcodeCheckSig treats the top 2 items on the stack as a public key and a
1964// signature and replaces them with a bool which indicates if the signature was

Callers

nothing calls this directly

Calls 2

ByteIndexMethod · 0.80
OpcodePositionMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…