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

Method NipN

txscript/stack.go:175–178  ·  view source on GitHub ↗

NipN removes the Nth object on the stack Stack transformation: NipN(0): [... x1 x2 x3] -> [... x1 x2] NipN(1): [... x1 x2 x3] -> [... x1 x3] NipN(2): [... x1 x2 x3] -> [... x2 x3]

(idx int32)

Source from the content-addressed store, hash-verified

173// NipN(1): [... x1 x2 x3] -> [... x1 x3]
174// NipN(2): [... x1 x2 x3] -> [... x2 x3]
175func (s *stack) NipN(idx int32) error {
176 _, err := s.nipN(idx)
177 return err
178}
179
180// Tuck copies the item at the top of the stack and inserts it before the 2nd
181// to top item.

Callers 2

TestStackFunction · 0.95
opcodeNipFunction · 0.80

Calls 1

nipNMethod · 0.95

Tested by 1

TestStackFunction · 0.76