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

Method PeekInt

txscript/stack.go:120–127  ·  view source on GitHub ↗

PeekInt returns the Nth item on the stack as a script num without removing it. The act of converting to a script num enforces the consensus rules imposed on data interpreted as numbers.

(idx int32)

Source from the content-addressed store, hash-verified

118// it. The act of converting to a script num enforces the consensus rules
119// imposed on data interpreted as numbers.
120func (s *stack) PeekInt(idx int32) (scriptNum, error) {
121 so, err := s.PeekByteArray(idx)
122 if err != nil {
123 return 0, err
124 }
125
126 return MakeScriptNum(so, s.verifyMinimalData, maxScriptNumLen)
127}
128
129// PeekBool returns the Nth item on the stack as a bool without removing it.
130func (s *stack) PeekBool(idx int32) (bool, error) {

Callers 1

TestStackFunction · 0.95

Calls 2

PeekByteArrayMethod · 0.95
MakeScriptNumFunction · 0.85

Tested by 1

TestStackFunction · 0.76