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

Function opcodeSwap

txscript/opcode.go:1367–1369  ·  view source on GitHub ↗

opcodeSwap swaps the top two items on the stack. Stack transformation: [... x1 x2] -> [... x2 x1]

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

Source from the content-addressed store, hash-verified

1365//
1366// Stack transformation: [... x1 x2] -> [... x2 x1]
1367func opcodeSwap(op *opcode, data []byte, vm *Engine) error {
1368 return vm.dstack.SwapN(1)
1369}
1370
1371// opcodeTuck inserts a duplicate of the top item of the data stack before the
1372// second-to-top item.

Callers

nothing calls this directly

Calls 1

SwapNMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…