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

Function opcodeN

txscript/opcode.go:809–814  ·  view source on GitHub ↗

opcodeN is a common handler for the small integer data push opcodes. It pushes the numeric value the opcode represents (which will be from 1 to 16) onto the data stack.

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

Source from the content-addressed store, hash-verified

807// pushes the numeric value the opcode represents (which will be from 1 to 16)
808// onto the data stack.
809func opcodeN(op *opcode, data []byte, vm *Engine) error {
810 // The opcodes are all defined consecutively, so the numeric value is
811 // the difference.
812 vm.dstack.PushInt(scriptNum((op.value - (OP_1 - 1))))
813 return nil
814}
815
816// opcodeNop is a common handler for the NOP family of opcodes. As the name
817// implies it generally does nothing, however, it will return an error when

Callers

nothing calls this directly

Calls 2

scriptNumTypeAlias · 0.85
PushIntMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…