MCPcopy
hub / github.com/btcsuite/btcd / PopBool

Method PopBool

txscript/stack.go:96–103  ·  view source on GitHub ↗

PopBool pops the value off the top of the stack, converts it into a bool, and returns it. Stack transformation: [... x1 x2 x3] -> [... x1 x2]

()

Source from the content-addressed store, hash-verified

94//
95// Stack transformation: [... x1 x2 x3] -> [... x1 x2]
96func (s *stack) PopBool() (bool, error) {
97 so, err := s.PopByteArray()
98 if err != nil {
99 return false, err
100 }
101
102 return asBool(so), nil
103}
104
105// PeekByteArray returns the Nth item on the stack without removing it.
106func (s *stack) PeekByteArray(idx int32) ([]byte, error) {

Callers 4

TestStackFunction · 0.95
CheckErrorConditionMethod · 0.80
popIfBoolFunction · 0.80
abstractVerifyFunction · 0.80

Calls 2

PopByteArrayMethod · 0.95
asBoolFunction · 0.85

Tested by 1

TestStackFunction · 0.76