Integer tempalte matching opcode.
authorCryptoManiac <balthazar@yandex.ru>
Sun, 21 Feb 2016 21:12:33 +0000 (00:12 +0300)
committerCryptoManiac <balthazar@yandex.ru>
Sun, 21 Feb 2016 21:12:33 +0000 (00:12 +0300)
src/script.cpp
src/script.h

index 942ddc8..1b504e4 100644 (file)
@@ -1342,6 +1342,20 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector<vector<unsi
                 else
                     break;
             }
+            else if (opcode2 == OP_INTEGER)
+            {   // Up to four-byte integer pushed onto vSolutions
+                try
+                {
+                    CBigNum bnVal = CastToBigNum(vch1);
+                    if (bnVal <= 16)
+                        break; // It's better to use OP_0 ... OP_16 for small integers.
+                    vSolutionsRet.push_back(vch1);
+                }
+                catch(...)
+                {
+                    break;
+                }
+            }
             else if (opcode2 == OP_SMALLDATA)
             {
                 // small pushdata, <= 1024 bytes
index a99bcbc..7d47989 100644 (file)
@@ -222,12 +222,11 @@ enum opcodetype
     OP_NOP9 = 0xb8,
     OP_NOP10 = 0xb9,
 
-
-
     // template matching params
     OP_SMALLDATA = 0xf9,
     OP_SMALLINTEGER = 0xfa,
     OP_PUBKEYS = 0xfb,
+    OP_INTEGER = 0xfc,
     OP_PUBKEYHASH = 0xfd,
     OP_PUBKEY = 0xfe,