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

Function opcodeToAltStack

txscript/opcode.go:1202–1210  ·  view source on GitHub ↗

opcodeToAltStack removes the top item from the main data stack and pushes it onto the alternate data stack. Main data stack transformation: [... x1 x2 x3] -> [... x1 x2] Alt data stack transformation: [... y1 y2 y3] -> [... y1 y2 y3 x3]

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

Source from the content-addressed store, hash-verified

1200// Main data stack transformation: [... x1 x2 x3] -> [... x1 x2]
1201// Alt data stack transformation: [... y1 y2 y3] -> [... y1 y2 y3 x3]
1202func opcodeToAltStack(op *opcode, data []byte, vm *Engine) error {
1203 so, err := vm.dstack.PopByteArray()
1204 if err != nil {
1205 return err
1206 }
1207 vm.astack.PushByteArray(so)
1208
1209 return nil
1210}
1211
1212// opcodeFromAltStack removes the top item from the alternate data stack and
1213// pushes it onto the main data stack.

Callers

nothing calls this directly

Calls 2

PopByteArrayMethod · 0.80
PushByteArrayMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…