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

Function opcode1Add

txscript/opcode.go:1430–1438  ·  view source on GitHub ↗

opcode1Add treats the top item on the data stack as an integer and replaces it with its incremented value (plus 1). Stack transformation: [... x1 x2] -> [... x1 x2+1]

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

Source from the content-addressed store, hash-verified

1428//
1429// Stack transformation: [... x1 x2] -> [... x1 x2+1]
1430func opcode1Add(op *opcode, data []byte, vm *Engine) error {
1431 m, err := vm.dstack.PopInt()
1432 if err != nil {
1433 return err
1434 }
1435
1436 vm.dstack.PushInt(m + 1)
1437 return nil
1438}
1439
1440// opcode1Sub treats the top item on the data stack as an integer and replaces
1441// it with its decremented value (minus 1).

Callers

nothing calls this directly

Calls 2

PopIntMethod · 0.80
PushIntMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…