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)
| 118 | // it. The act of converting to a script num enforces the consensus rules |
| 119 | // imposed on data interpreted as numbers. |
| 120 | func (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. |
| 130 | func (s *stack) PeekBool(idx int32) (bool, error) { |