opcodeNumNotEqual treats the top two items on the data stack as integers. When they are NOT equal, they are replaced with a 1, otherwise a 0. Stack transformation (x1==x2): [... 5 5] -> [... 0] Stack transformation (x1!=x2): [... 5 7] -> [... 1]
(op *opcode, data []byte, vm *Engine)
| 1667 | // Stack transformation (x1==x2): [... 5 5] -> [... 0] |
| 1668 | // Stack transformation (x1!=x2): [... 5 7] -> [... 1] |
| 1669 | func opcodeNumNotEqual(op *opcode, data []byte, vm *Engine) error { |
| 1670 | v0, err := vm.dstack.PopInt() |
| 1671 | if err != nil { |
| 1672 | return err |
| 1673 | } |
| 1674 | |
| 1675 | v1, err := vm.dstack.PopInt() |
| 1676 | if err != nil { |
| 1677 | return err |
| 1678 | } |
| 1679 | |
| 1680 | if v0 != v1 { |
| 1681 | vm.dstack.PushInt(scriptNum(1)) |
| 1682 | } else { |
| 1683 | vm.dstack.PushInt(scriptNum(0)) |
| 1684 | } |
| 1685 | |
| 1686 | return nil |
| 1687 | } |
| 1688 | |
| 1689 | // opcodeLessThan treats the top two items on the data stack as integers. When |
| 1690 | // the second-to-top item is less than the top item, they are replaced with a 1, |