Satoshi MailBeta Open in Satoshi Mail

reverted makefile.unix wx-config -- version 0.3.6

Commit by Satoshi Nakamoto (--author=Satoshi Nakamoto) on 30 July 2010 · release v0.3.6 · 6 files, +718 −655

Open in Satoshi Mail View on GitHub

Files changed

bignum.h
@@ -401,7 +401,8 @@ public:
 
     CBigNum& operator>>=(unsigned int shift)
     {
-        // Note: BN_rshift segfaults on 64-bit ubuntu 9.10 if 2^shift is greater than the number
+        // Note: BN_rshift segfaults on 64-bit ubuntu 9.10 if 2^shift is greater than the number,
+        //       tested OK on 64-bit ubuntu 10.4
         if (!BN_rshift(this, this, shift))
             throw bignum_error("CBigNum:operator>>= : BN_rshift failed");
         return *this;
makefile.unix
@@ -3,12 +3,21 @@
 # file license.txt or http://www.opensource.org/licenses/mit-license.php.
 
 
-WXLIBS=$(shell wx-config --debug=yes --libs --static)
-WXFLAGS=$(shell wx-config --debug=yes --cppflags)
+INCLUDEPATHS= \
+ -I"/usr/include" \
+ -I"/usr/local/include/wx-2.9" \
+ -I"/usr/local/lib/wx/include/gtk2-unicode-debug-static-2.9"
 
 LIBPATHS= \
+ -L"/usr/lib" \
  -L"/usr/local/lib"
 
+WXLIBS= \
+ -Wl,-Bstatic \
+   -l wx_gtk2ud-2.9 \
+ -Wl,-Bdynamic \
+   -l gtk-x11-2.0 -l SM
+
 LIBS= \
  -Wl,-Bstatic \
    -l boost_system \
@@ -22,7 +31,7 @@ LIBS= \
 
 DEFS=-D__WXGTK__ -DNOPCH
 DEBUGFLAGS=-g -D__WXDEBUG__
-CFLAGS=-O2 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS)
+CFLAGS=-O2 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
 HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
     script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h noui.h init.h
 
@@ -43,10 +52,10 @@ all: bitcoin
 
 
 headers.h.gch: headers.h $(HEADERS)
-	g++ -c $(CFLAGS) $(WXFLAGS) -DGUI -o $@ $<
+	g++ -c $(CFLAGS) -DGUI -o $@ $<
 
 obj/%.o: %.cpp $(HEADERS) headers.h.gch
-	g++ -c $(CFLAGS) $(WXFLAGS) -DGUI -o $@ $<
+	g++ -c $(CFLAGS) -DGUI -o $@ $<
 
 cryptopp/obj/%.o: cryptopp/%.cpp
 	g++ -c $(CFLAGS) -O3 -DCRYPTOPP_DISABLE_SSE2 -o $@ $<
script.cpp
@@ -16,6 +16,7 @@ static const CBigNum bnZero(0);
 static const CBigNum bnOne(1);
 static const CBigNum bnFalse(0);
 static const CBigNum bnTrue(1);
+static const size_t nMaxNumSize = 258;
 
 
 bool CastToBool(const valtype& vch)
@@ -53,752 +54,779 @@ bool EvalScript(const CScript& script, const CTransaction& txTo, unsigned int nI
     vector<valtype> altstack;
     if (pvStackRet)
         pvStackRet->clear();
+    if (script.size() > 20000)
+        return false;
 
 
-    while (pc < pend)
+    try
     {
-        bool fExec = !count(vfExec.begin(), vfExec.end(), false);
-
-        //
-        // Read instruction
-        //
-        opcodetype opcode;
-        valtype vchPushValue;
-        if (!script.GetOp(pc, opcode, vchPushValue))
-            return false;
-
-        if (fExec && opcode <= OP_PUSHDATA4)
-            stack.push_back(vchPushValue);
-        else if (fExec || (OP_IF <= opcode && opcode <= OP_ENDIF))
-        switch (opcode)
+        while (pc < pend)
         {
-            //
-            // Push value
-            //
-            case OP_1NEGATE:
-            case OP_1:
-            case OP_2:
-            case OP_3:
-            case OP_4:
-            case OP_5:
-            case OP_6:
-            case OP_7:
-            case OP_8:
-            case OP_9:
-            case OP_10:
-            case OP_11:
-            case OP_12:
-            case OP_13:
-            case OP_14:
-            case OP_15:
-            case OP_16:
-            {
-                // ( -- value)
-                CBigNum bn((int)opcode - (int)(OP_1 - 1));
-                stack.push_back(bn.getvch());
-            }
-            break;
-
+            bool fExec = !count(vfExec.begin(), vfExec.end(), false);
 
             //
-            // Control
+            // Read instruction
             //
-            case OP_NOP:
-            break;
-
-            case OP_VER:
-            {
-                CBigNum bn(VERSION);
-                stack.push_back(bn.getvch());
-            }
-            break;
+            opcodetype opcode;
+            valtype vchPushValue;
+            if (!script.GetOp(pc, opcode, vchPushValue))
+                return false;
+            if (vchPushValue.size() > 5000)
+                return false;
 
-            case OP_IF:
-            case OP_NOTIF:
-            case OP_VERIF:
-            case OP_VERNOTIF:
+            if (fExec && opcode <= OP_PUSHDATA4)
+                stack.push_back(vchPushValue);
+            else if (fExec || (OP_IF <= opcode && opcode <= OP_ENDIF))
+            switch (opcode)
             {
-                // <expression> if [statements] [else [statements]] endif
-                bool fValue = false;
-                if (fExec)
+                //
+                // Push value
+                //
+                case OP_1NEGATE:
+                case OP_1:
+                case OP_2:
+                case OP_3:
+                case OP_4:
+                case OP_5:
+                case OP_6:
+                case OP_7:
+                case OP_8:
+                case OP_9:
+                case OP_10:
+                case OP_11:
+                case OP_12:
+                case OP_13:
+                case OP_14:
+                case OP_15:
+                case OP_16:
                 {
-                    if (stack.size() < 1)
-                        return false;
-                    valtype& vch = stacktop(-1);
-                    if (opcode == OP_VERIF || opcode == OP_VERNOTIF)
-                        fValue = (CBigNum(VERSION) >= CBigNum(vch));
-                    else
-                        fValue = CastToBool(vch);
-                    if (opcode == OP_NOTIF || opcode == OP_VERNOTIF)
-                        fValue = !fValue;
-                    stack.pop_back();
+                    // ( -- value)
+                    CBigNum bn((int)opcode - (int)(OP_1 - 1));
+                    stack.push_back(bn.getvch());
                 }
-                vfExec.push_back(fValue);
-            }
-            break;
-
-            case OP_ELSE:
-            {
-                if (vfExec.empty())
-                    return false;
-                vfExec.back() = !vfExec.back();
-            }
-            break;
-
-            case OP_ENDIF:
-            {
-                if (vfExec.empty())
-                    return false;
-                vfExec.pop_back();
-            }
-            break;
-
-            case OP_VERIFY:
-            {
-                // (true -- ) or
-                // (false -- false) and return
-                if (stack.size() < 1)
-                    return false;
-                bool fValue = CastToBool(stacktop(-1));
-                if (fValue)
-                    stack.pop_back();
-                else
-                    pc = pend;
-            }
-            break;
-
-            case OP_RETURN:
-            {
-                pc = pend;
-            }
-            break;
+                break;
 
 
-            //
-            // Stack ops
-            //
-            case OP_TOALTSTACK:
-            {
-                if (stack.size() < 1)
-                    return false;
-                altstack.push_back(stacktop(-1));
-                stack.pop_back();
-            }
-            break;
+                //
+                // Control
+                //
+                case OP_NOP:
+                case OP_NOP1: case OP_NOP2: case OP_NOP3: case OP_NOP4: case OP_NOP5:
+                case OP_NOP6: case OP_NOP7: case OP_NOP8: case OP_NOP9: case OP_NOP10:
+                break;
 
-            case OP_FROMALTSTACK:
-            {
-                if (altstack.size() < 1)
+                case OP_VER:
+                case OP_VERIF:
+                case OP_VERNOTIF:
+                {
                     return false;
-                stack.push_back(altstacktop(-1));
-                altstack.pop_back();
-            }
-            break;
+                }
+                break;
 
-            case OP_2DROP:
-            {
-                // (x1 x2 -- )
-                stack.pop_back();
-                stack.pop_back();
-            }
-            break;
+                case OP_IF:
+                case OP_NOTIF:
+                {
+                    // <expression> if [statements] [else [statements]] endif
+                    bool fValue = false;
+                    if (fExec)
+                    {
+                        if (stack.size() < 1)
+                            return false;
+                        valtype& vch = stacktop(-1);
+                        fValue = CastToBool(vch);
+                        if (opcode == OP_NOTIF)
+                            fValue = !fValue;
+                        stack.pop_back();
+                    }
+                    vfExec.push_back(fValue);
+                }
+                break;
 
-            case OP_2DUP:
-            {
-                // (x1 x2 -- x1 x2 x1 x2)
-                if (stack.size() < 2)
-                    return false;
-                valtype vch1 = stacktop(-2);
-                valtype vch2 = stacktop(-1);
-                stack.push_back(vch1);
-                stack.push_back(vch2);
-            }
-            break;
+                case OP_ELSE:
+                {
+                    if (vfExec.empty())
+                        return false;
+                    vfExec.back() = !vfExec.back();
+                }
+                break;
 
-            case OP_3DUP:
-            {
-                // (x1 x2 x3 -- x1 x2 x3 x1 x2 x3)
-                if (stack.size() < 3)
-                    return false;
-                valtype vch1 = stacktop(-3);
-                valtype vch2 = stacktop(-2);
-                valtype vch3 = stacktop(-1);
-                stack.push_back(vch1);
-                stack.push_back(vch2);
-                stack.push_back(vch3);
-            }
-            break;
+                case OP_ENDIF:
+                {
+                    if (vfExec.empty())
+                        return false;
+                    vfExec.pop_back();
+                }
+                break;
 
-            case OP_2OVER:
-            {
-                // (x1 x2 x3 x4 -- x1 x2 x3 x4 x1 x2)
-                if (stack.size() < 4)
-                    return false;
-                valtype vch1 = stacktop(-4);
-                valtype vch2 = stacktop(-3);
-                stack.push_back(vch1);
-                stack.push_back(vch2);
-            }
-            break;
+                case OP_VERIFY:
+                {
+                    // (true -- ) or
+                    // (false -- false) and return
+                    if (stack.size() < 1)
+                        return false;
+                    bool fValue = CastToBool(stacktop(-1));
+                    if (fValue)
+                        stack.pop_back();
+                    else
+                        return false;
+                }
+                break;
 
-            case OP_2ROT:
-            {
script.h
@@ -136,6 +136,20 @@ enum opcodetype
     OP_CHECKMULTISIG,
     OP_CHECKMULTISIGVERIFY,
 
+    // expansion
+    OP_NOP1,
+    OP_NOP2,
+    OP_NOP3,
+    OP_NOP4,
+    OP_NOP5,
+    OP_NOP6,
+    OP_NOP7,
+    OP_NOP8,
+    OP_NOP9,
+    OP_NOP10,
+
+
+
 
     // multi-byte opcodes
     OP_SINGLEBYTE_END = 0xF0,
@@ -276,6 +290,18 @@ inline const char* GetOpName(opcodetype opcode)
     case OP_CHECKMULTISIG          : return "OP_CHECKMULTISIG";
     case OP_CHECKMULTISIGVERIFY    : return "OP_CHECKMULTISIGVERIFY";
 
+    // expanson
+    case OP_NOP1                   : return "OP_NOP1";
+    case OP_NOP2                   : return "OP_NOP2";
+    case OP_NOP3                   : return "OP_NOP3";
+    case OP_NOP4                   : return "OP_NOP4";
+    case OP_NOP5                   : return "OP_NOP5";
+    case OP_NOP6                   : return "OP_NOP6";
+    case OP_NOP7                   : return "OP_NOP7";
+    case OP_NOP8                   : return "OP_NOP8";
+    case OP_NOP9                   : return "OP_NOP9";
+    case OP_NOP10                  : return "OP_NOP10";
+
 
 
     // multi-byte opcodes
@@ -285,7 +311,6 @@ inline const char* GetOpName(opcodetype opcode)
     case OP_PUBKEYHASH             : return "OP_PUBKEYHASH";
 
 
-
     case OP_INVALIDOPCODE          : return "OP_INVALIDOPCODE";
     default:
         return "UNKNOWN_OPCODE";
serialize.h
@@ -19,8 +19,8 @@ class CScript;
 class CDataStream;
 class CAutoFile;
 
-static const int VERSION = 304;
-static const char* pszSubVer = ".0";
+static const int VERSION = 306;
+static const char* pszSubVer = "";
 
 
 
setup.nsi
@@ -7,7 +7,7 @@ RequestExecutionLevel highest
 
 # General Symbol Definitions
 !define REGKEY "SOFTWARE\$(^Name)"
-!define VERSION 0.3.3
+!define VERSION 0.3.6
 !define COMPANY "Bitcoin project"
 !define URL http://www.bitcoin.org/
 
@@ -42,12 +42,12 @@ Var StartMenuGroup
 !insertmacro MUI_LANGUAGE English
 
 # Installer attributes
-OutFile bitcoin-0.3.3-win32-setup.exe
+OutFile bitcoin-0.3.6-win32-setup.exe
 InstallDir $PROGRAMFILES\Bitcoin
 CRCCheck on
 XPStyle on
 ShowInstDetails show
-VIProductVersion 0.3.3.0
+VIProductVersion 0.3.6.0
 VIAddVersionKey ProductName Bitcoin
 VIAddVersionKey ProductVersion "${VERSION}"
 VIAddVersionKey CompanyName "${COMPANY}"