opcodeLessThan treats the top two items on the data stack as integers. When the second-to-top item is less than the top item, they are replaced with a 1, otherwise a 0. Stack transformation: [... x1 x2] -> [... bool]
(op *opcode, data []byte, vm *Engine)
| 1692 | // |
| 1693 | // Stack transformation: [... x1 x2] -> [... bool] |
| 1694 | func opcodeLessThan(op *opcode, data []byte, vm *Engine) error { |
| 1695 | v0, err := vm.dstack.PopInt() |
| 1696 | if err != nil { |
| 1697 | return err |
| 1698 | } |
| 1699 | |
| 1700 | v1, err := vm.dstack.PopInt() |
| 1701 | if err != nil { |
| 1702 | return err |
| 1703 | } |
| 1704 | |
| 1705 | if v1 < v0 { |
| 1706 | vm.dstack.PushInt(scriptNum(1)) |
| 1707 | } else { |
| 1708 | vm.dstack.PushInt(scriptNum(0)) |
| 1709 | } |
| 1710 | |
| 1711 | return nil |
| 1712 | } |
| 1713 | |
| 1714 | // opcodeGreaterThan treats the top two items on the data stack as integers. |
| 1715 | // When the second-to-top item is greater than the top item, they are replaced |