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

Function opcodeSize

txscript/opcode.go:1383–1391  ·  view source on GitHub ↗

opcodeSize pushes the size of the top item of the data stack onto the data stack. Stack transformation: [... x1] -> [... x1 len(x1)]

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

Source from the content-addressed store, hash-verified

1381//
1382// Stack transformation: [... x1] -> [... x1 len(x1)]
1383func opcodeSize(op *opcode, data []byte, vm *Engine) error {
1384 so, err := vm.dstack.PeekByteArray(0)
1385 if err != nil {
1386 return err
1387 }
1388
1389 vm.dstack.PushInt(scriptNum(len(so)))
1390 return nil
1391}
1392
1393// opcodeEqual removes the top 2 items of the data stack, compares them as raw
1394// bytes, and pushes the result, encoded as a boolean, back to the stack.

Callers

nothing calls this directly

Calls 3

scriptNumTypeAlias · 0.85
PeekByteArrayMethod · 0.80
PushIntMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…