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

Function opcodeDepth

txscript/opcode.go:1294–1297  ·  view source on GitHub ↗

opcodeDepth pushes the depth of the data stack prior to executing this opcode, encoded as a number, onto the data stack. Stack transformation: [...] -> [... ] Example with 2 items: [x1 x2] -> [x1 x2 2] Example with 3 items: [x1 x2 x3] -> [x1 x2 x3 3]

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

Source from the content-addressed store, hash-verified

1292// Example with 2 items: [x1 x2] -> [x1 x2 2]
1293// Example with 3 items: [x1 x2 x3] -> [x1 x2 x3 3]
1294func opcodeDepth(op *opcode, data []byte, vm *Engine) error {
1295 vm.dstack.PushInt(scriptNum(vm.dstack.Depth()))
1296 return nil
1297}
1298
1299// opcodeDrop removes the top item from the data stack.
1300//

Callers

nothing calls this directly

Calls 3

scriptNumTypeAlias · 0.85
PushIntMethod · 0.80
DepthMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…