PopInt pops the value off the top of the stack, converts it into a script num, and returns it. The act of converting to a script num enforces the consensus rules imposed on data interpreted as numbers. Stack transformation: [... x1 x2 x3] -> [... x1 x2]
()
| 81 | // |
| 82 | // Stack transformation: [... x1 x2 x3] -> [... x1 x2] |
| 83 | func (s *stack) PopInt() (scriptNum, error) { |
| 84 | so, err := s.PopByteArray() |
| 85 | if err != nil { |
| 86 | return 0, err |
| 87 | } |
| 88 | |
| 89 | return MakeScriptNum(so, s.verifyMinimalData, maxScriptNumLen) |
| 90 | } |
| 91 | |
| 92 | // PopBool pops the value off the top of the stack, converts it into a bool, and |
| 93 | // returns it. |