diff options
37 files changed, 166 insertions, 127 deletions
diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro index 5d359c054a..a157f41e97 100644 --- a/bitcoin-qt.pro +++ b/bitcoin-qt.pro @@ -1,6 +1,6 @@ TEMPLATE = app TARGET = -VERSION = 0.6.0 +VERSION = 0.6.1 INCLUDEPATH += src src/json src/qt DEFINES += QT_GUI BOOST_THREAD_USE_LIB CONFIG += no_include_pwd diff --git a/contrib/gitian-descriptors/deps-win32.yml b/contrib/gitian-descriptors/deps-win32.yml index 776a8da00a..df1e3de358 100644 --- a/contrib/gitian-descriptors/deps-win32.yml +++ b/contrib/gitian-descriptors/deps-win32.yml @@ -13,7 +13,7 @@ packages: reference_datetime: "2011-01-30 00:00:00" remotes: [] files: -- "openssl-1.0.0e.tar.gz" +- "openssl-1.0.1b.tar.gz" - "db-4.8.30.NC.tar.gz" - "miniupnpc-1.6.tar.gz" - "zlib-1.2.6.tar.gz" @@ -25,8 +25,8 @@ script: | export FAKETIME=$REFERENCE_DATETIME export TZ=UTC # - tar xzf openssl-1.0.0e.tar.gz - cd openssl-1.0.0e + tar xzf openssl-1.0.1b.tar.gz + cd openssl-1.0.1b ./Configure --cross-compile-prefix=i586-mingw32msvc- mingw make cd .. @@ -62,7 +62,7 @@ script: | make $MAKEOPTS cd .. # - zip -r $OUTDIR/bitcoin-deps-0.0.3.zip \ + zip -r $OUTDIR/bitcoin-deps-0.0.4.zip \ $(ls qrencode-*/{qrencode.h,.libs/libqrencode.{,l}a} | sort) \ $(ls db-*/build_unix/{libdb_cxx.a,db.h,db_cxx.h,libdb.a,.libs/libdb_cxx-?.?.a} | sort) \ $(find openssl-* -name '*.a' -o -name '*.h' | sort) \ diff --git a/contrib/gitian-descriptors/gitian-win32.yml b/contrib/gitian-descriptors/gitian-win32.yml index 49bc9c7a57..9752626d6a 100644 --- a/contrib/gitian-descriptors/gitian-win32.yml +++ b/contrib/gitian-descriptors/gitian-win32.yml @@ -17,7 +17,7 @@ remotes: files: - "qt-win32-4.7.4-gitian.zip" - "boost-win32-1.47.0-gitian.zip" -- "bitcoin-deps-0.0.3.zip" +- "bitcoin-deps-0.0.4.zip" script: | # mkdir $HOME/qt @@ -39,7 +39,7 @@ script: | mv include/boost . cd .. # - unzip bitcoin-deps-0.0.3.zip + unzip bitcoin-deps-0.0.4.zip # find -type f | xargs touch --date="$REFERENCE_DATETIME" # @@ -51,7 +51,7 @@ script: | export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 export FAKETIME=$REFERENCE_DATETIME export TZ=UTC - $HOME/qt/src/bin/qmake -spec unsupported/win32-g++-cross MINIUPNPC_LIB_PATH=$HOME/build/miniupnpc MINIUPNPC_INCLUDE_PATH=$HOME/build/ BDB_LIB_PATH=$HOME/build/db-4.8.30.NC/build_unix BDB_INCLUDE_PATH=$HOME/build/db-4.8.30.NC/build_unix BOOST_LIB_PATH=$HOME/build/boost_1_47_0/stage/lib BOOST_INCLUDE_PATH=$HOME/build/boost_1_47_0 BOOST_LIB_SUFFIX=-mt-s BOOST_THREAD_LIB_SUFFIX=_win32-mt-s OPENSSL_LIB_PATH=$HOME/build/openssl-1.0.0e OPENSSL_INCLUDE_PATH=$HOME/build/openssl-1.0.0e/include QRENCODE_LIB_PATH=$HOME/build/qrencode-3.2.0/.libs QRENCODE_INCLUDE_PATH=$HOME/build/qrencode-3.2.0 USE_QRCODE=1 INCLUDEPATH=$HOME/build DEFINES=BOOST_THREAD_USE_LIB BITCOIN_NEED_QT_PLUGINS=1 QMAKE_LRELEASE=lrelease QMAKE_CXXFLAGS=-frandom-seed=bitcoin QMAKE_LFLAGS=-frandom-seed=bitcoin USE_BUILD_INFO=1 + $HOME/qt/src/bin/qmake -spec unsupported/win32-g++-cross MINIUPNPC_LIB_PATH=$HOME/build/miniupnpc MINIUPNPC_INCLUDE_PATH=$HOME/build/ BDB_LIB_PATH=$HOME/build/db-4.8.30.NC/build_unix BDB_INCLUDE_PATH=$HOME/build/db-4.8.30.NC/build_unix BOOST_LIB_PATH=$HOME/build/boost_1_47_0/stage/lib BOOST_INCLUDE_PATH=$HOME/build/boost_1_47_0 BOOST_LIB_SUFFIX=-mt-s BOOST_THREAD_LIB_SUFFIX=_win32-mt-s OPENSSL_LIB_PATH=$HOME/build/openssl-1.0.1b OPENSSL_INCLUDE_PATH=$HOME/build/openssl-1.0.1b/include QRENCODE_LIB_PATH=$HOME/build/qrencode-3.2.0/.libs QRENCODE_INCLUDE_PATH=$HOME/build/qrencode-3.2.0 USE_QRCODE=1 INCLUDEPATH=$HOME/build DEFINES=BOOST_THREAD_USE_LIB BITCOIN_NEED_QT_PLUGINS=1 QMAKE_LRELEASE=lrelease QMAKE_CXXFLAGS=-frandom-seed=bitcoin QMAKE_LFLAGS=-frandom-seed=bitcoin USE_BUILD_INFO=1 make $MAKEOPTS cp release/bitcoin-qt.exe $OUTDIR/ # diff --git a/doc/README b/doc/README index 00694e2ae1..aa89960959 100644 --- a/doc/README +++ b/doc/README @@ -1,4 +1,4 @@ -Bitcoin 0.6.0 BETA +Bitcoin 0.6.1rc1 BETA Copyright (c) 2009-2012 Bitcoin Developers Distributed under the MIT/X11 software license, see the accompanying diff --git a/doc/README_windows.txt b/doc/README_windows.txt index 9aa5aa744f..6b48b1d1e5 100644 --- a/doc/README_windows.txt +++ b/doc/README_windows.txt @@ -1,4 +1,4 @@ -Bitcoin 0.6.0 BETA
+Bitcoin 0.6.1rc1 BETA
Copyright (c) 2009-2012 Bitcoin Developers
Distributed under the MIT/X11 software license, see the accompanying
diff --git a/doc/build-msw.txt b/doc/build-msw.txt index 7e3d1a7cbf..b1805154e1 100644 --- a/doc/build-msw.txt +++ b/doc/build-msw.txt @@ -24,7 +24,7 @@ Dependencies Libraries you need to download separately and build: default path download -OpenSSL \openssl-1.0.0d-mgw http://www.openssl.org/source/ +OpenSSL \openssl-1.0.1b-mgw http://www.openssl.org/source/ Berkeley DB \db-4.8.30.NC-mgw http://www.oracle.com/technology/software/products/berkeley-db/index.html Boost \boost-1.47.0-mgw http://www.boost.org/users/download/ miniupnpc \miniupnpc-1.6-mgw http://miniupnp.tuxfamily.org/files/ @@ -36,7 +36,7 @@ Boost MIT-like license miniupnpc New (3-clause) BSD license Versions used in this release: -OpenSSL 1.0.0e +OpenSSL 1.0.1b Berkeley DB 4.8.30.NC Boost 1.47.0 miniupnpc 1.6 @@ -48,7 +48,7 @@ MSYS shell: un-tar sources with MSYS 'tar xfz' to avoid issue with symlinks (OpenSSL ticket 2377) change 'MAKE' env. variable from 'C:\MinGW32\bin\mingw32-make.exe' to '/c/MinGW32/bin/mingw32-make.exe' -cd /c/openssl-1.0.0e-mgw +cd /c/openssl-1.0.1b-mgw ./config make diff --git a/doc/release-process.txt b/doc/release-process.txt index 3f3c6dad6a..00fafa4818 100644 --- a/doc/release-process.txt +++ b/doc/release-process.txt @@ -2,7 +2,7 @@ * update (commit) version in sources bitcoin-qt.pro - src/version.cpp + src/version.h share/setup.nsi doc/README* @@ -24,7 +24,7 @@ * Fetch and build inputs: mkdir -p inputs; cd inputs/ wget 'http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.6.tar.gz' -O miniupnpc-1.6.tar.gz - wget 'http://www.openssl.org/source/openssl-1.0.0e.tar.gz' + wget 'http://www.openssl.org/source/openssl-1.0.1b.tar.gz' wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz' wget 'http://zlib.net/zlib-1.2.6.tar.gz' wget 'ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.5.9.tar.gz' diff --git a/share/setup.nsi b/share/setup.nsi index 4dc2ad5f05..fa33bd9786 100644 --- a/share/setup.nsi +++ b/share/setup.nsi @@ -5,7 +5,7 @@ SetCompressor /SOLID lzma # General Symbol Definitions
!define REGKEY "SOFTWARE\$(^Name)"
-!define VERSION 0.6.0
+!define VERSION 0.6.1
!define COMPANY "Bitcoin project"
!define URL http://www.bitcoin.org/
@@ -45,13 +45,13 @@ Var StartMenuGroup !insertmacro MUI_LANGUAGE English
# Installer attributes
-OutFile bitcoin-0.6.0-win32-setup.exe
+OutFile bitcoin-0.6.1rc1-win32-setup.exe
InstallDir $PROGRAMFILES\Bitcoin
CRCCheck on
XPStyle on
BrandingText " "
ShowInstDetails show
-VIProductVersion 0.6.0.99
+VIProductVersion 0.6.1.1
VIAddVersionKey ProductName Bitcoin
VIAddVersionKey ProductVersion "${VERSION}"
VIAddVersionKey CompanyName "${COMPANY}"
diff --git a/src/bignum.h b/src/bignum.h index 0d57dc8a8e..f0971e8850 100644 --- a/src/bignum.h +++ b/src/bignum.h @@ -117,9 +117,9 @@ public: { unsigned long n = BN_get_word(this); if (!BN_is_negative(this)) - return (n > std::numeric_limits<int>::max() ? std::numeric_limits<int>::max() : n); + return (n > (unsigned long)std::numeric_limits<int>::max() ? std::numeric_limits<int>::max() : n); else - return (n > std::numeric_limits<int>::max() ? std::numeric_limits<int>::min() : -(int)n); + return (n > (unsigned long)std::numeric_limits<int>::max() ? std::numeric_limits<int>::min() : -(int)n); } void setint64(int64 n) @@ -222,7 +222,7 @@ public: if (vch.size() > 4) vch[4] &= 0x7f; uint256 n = 0; - for (int i = 0, j = vch.size()-1; i < sizeof(n) && j >= 4; i++, j--) + for (unsigned int i = 0, j = vch.size()-1; i < sizeof(n) && j >= 4; i++, j--) ((unsigned char*)&n)[i] = vch[j]; return n; } diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 206347faf8..15bcf1da3d 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -999,7 +999,7 @@ Value addmultisigaddress(const Array& params, bool fHelp) strAccount = AccountFromValue(params[2]); // Gather public keys - if (nRequired < 1 || keys.size() < nRequired) + if ((nRequired < 1) || ((int)keys.size() < nRequired)) throw runtime_error( strprintf("wrong number of keys" "(got %d, need at least %d)", keys.size(), nRequired)); @@ -1331,8 +1331,10 @@ Value listtransactions(const Array& params, bool fHelp) } // ret is newest to oldest - if (nFrom > ret.size()) nFrom = ret.size(); - if (nFrom+nCount > ret.size()) nCount = ret.size()-nFrom; + if (nFrom > (int)ret.size()) + nFrom = ret.size(); + if ((nFrom + nCount) > (int)ret.size()) + nCount = ret.size() - nFrom; Array::iterator first = ret.begin(); std::advance(first, nFrom); Array::iterator last = ret.begin(); @@ -1401,8 +1403,8 @@ Value listsinceblock(const Array& params, bool fHelp) { if (fHelp) throw runtime_error( - "listsinceblock [blockid] [target-confirmations]\n" - "Get all transactions in blocks since block [blockid], or all transactions if omitted"); + "listsinceblock [blockhash] [target-confirmations]\n" + "Get all transactions in blocks since block [blockhash], or all transactions if omitted"); CBlockIndex *pindex = NULL; int target_confirms = 1; @@ -1439,7 +1441,6 @@ Value listsinceblock(const Array& params, bool fHelp) if (target_confirms == 1) { - printf("oops!\n"); lastblock = hashBestChain; } else @@ -2202,7 +2203,7 @@ int ReadHTTP(std::basic_istream<char>& stream, map<string, string>& mapHeadersRe // Read header int nLen = ReadHTTPHeader(stream, mapHeadersRet); - if (nLen < 0 || nLen > MAX_SIZE) + if (nLen < 0 || nLen > (int)MAX_SIZE) return 500; // Read message diff --git a/src/compat.h b/src/compat.h index db340445b2..804a8141b5 100644 --- a/src/compat.h +++ b/src/compat.h @@ -21,10 +21,8 @@ #include <arpa/inet.h> #include <netdb.h> #include <net/if.h> -#include <ifaddrs.h> -#endif -#ifdef BSD #include <netinet/in.h> +#include <ifaddrs.h> #endif typedef u_int SOCKET; diff --git a/src/db.cpp b/src/db.cpp index 39a41894d7..12647e568a 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -28,6 +28,7 @@ unsigned int nWalletDBUpdated; CCriticalSection cs_db; static bool fDbEnvInit = false; +bool fDetachDB = false; DbEnv dbenv(0); map<string, int> mapFileUseCount; static map<string, Db*> mapDb; @@ -307,9 +308,13 @@ void DBFlush(bool fShutdown) { // Move log data to the dat file CloseDb(strFile); + printf("%s checkpoint\n", strFile.c_str()); dbenv.txn_checkpoint(0, 0, 0); - printf("%s flush\n", strFile.c_str()); - dbenv.lsn_reset(strFile.c_str(), 0); + if ((strFile != "blkindex.dat" && strFile != "addr.dat") || fDetachDB) { + printf("%s detach\n", strFile.c_str()); + dbenv.lsn_reset(strFile.c_str(), 0); + } + printf("%s closed\n", strFile.c_str()); mapFileUseCount.erase(mi++); } else @@ -648,7 +653,7 @@ bool CTxDB::LoadBlockIndex() } } // check level 4: check whether spent txouts were spent within the main chain - int nOutput = 0; + unsigned int nOutput = 0; if (nCheckLevel>3) { BOOST_FOREACH(const CDiskTxPos &txpos, txindex.vSpent) @@ -25,6 +25,7 @@ class CWallet; class CWalletTx; extern unsigned int nWalletDBUpdated; +extern bool fDetachDB; extern DbEnv dbenv; extern void DBFlush(bool fShutdown); diff --git a/src/init.cpp b/src/init.cpp index 14db9e7f5e..0671cd7799 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -150,11 +150,12 @@ bool AppInit2(int argc, char* argv[]) // If Qt is used, parameters/bitcoin.conf are parsed in qt/bitcoin.cpp's main() #if !defined(QT_GUI) ParseParameters(argc, argv); - if (!ReadConfigFile(mapArgs, mapMultiArgs)) + if (!boost::filesystem::is_directory(GetDataDir(false))) { fprintf(stderr, "Error: Specified directory does not exist\n"); Shutdown(NULL); } + ReadConfigFile(mapArgs, mapMultiArgs); #endif if (mapArgs.count("-?") || mapArgs.count("--help")) @@ -199,6 +200,7 @@ bool AppInit2(int argc, char* argv[]) #else " -upnp \t " + _("Use Universal Plug and Play to map the listening port (default: 0)") + "\n" + #endif + " -detachdb \t " + _("Detach block and address databases. Increases shutdown time (default: 0)") + "\n" + #endif " -paytxfee=<amt> \t " + _("Fee per KB to add to transactions you send") + "\n" + #ifdef QT_GUI @@ -254,6 +256,7 @@ bool AppInit2(int argc, char* argv[]) } fDebug = GetBoolArg("-debug"); + fDetachDB = GetBoolArg("-detachdb", false); #if !defined(WIN32) && !defined(QT_GUI) fDaemon = GetBoolArg("-daemon"); diff --git a/src/main.cpp b/src/main.cpp index 78d84d9064..e5d110d8ef 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -195,9 +195,9 @@ void static EraseOrphanTx(uint256 hash) mapOrphanTransactions.erase(hash); } -int LimitOrphanTxSize(int nMaxOrphans) +unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans) { - int nEvicted = 0; + unsigned int nEvicted = 0; while (mapOrphanTransactions.size() > nMaxOrphans) { // Evict a random orphan: @@ -297,6 +297,8 @@ bool CTransaction::AreInputsStandard(const MapPrevTx& mapInputs) const if (!Solver(prevScript, whichType, vSolutions)) return false; int nArgsExpected = ScriptSigArgsExpected(whichType, vSolutions); + if (nArgsExpected < 0) + return false; // Transactions with extra stuff in their scriptSigs are // non-standard. Note that this EvalScript() call will @@ -318,20 +320,25 @@ bool CTransaction::AreInputsStandard(const MapPrevTx& mapInputs) const return false; if (whichType2 == TX_SCRIPTHASH) return false; - nArgsExpected += ScriptSigArgsExpected(whichType2, vSolutions2); + + int tmpExpected; + tmpExpected = ScriptSigArgsExpected(whichType2, vSolutions2); + if (tmpExpected < 0) + return false; + nArgsExpected += tmpExpected; } - if (stack.size() != nArgsExpected) + if (stack.size() != (unsigned int)nArgsExpected) return false; } return true; } -int +unsigned int CTransaction::GetLegacySigOpCount() const { - int nSigOps = 0; + unsigned int nSigOps = 0; BOOST_FOREACH(const CTxIn& txin, vin) { nSigOps += txin.scriptSig.GetSigOpCount(false); @@ -369,10 +376,10 @@ int CMerkleTx::SetMerkleBranch(const CBlock* pblock) hashBlock = pblock->GetHash(); // Locate the transaction - for (nIndex = 0; nIndex < pblock->vtx.size(); nIndex++) + for (nIndex = 0; nIndex < (int)pblock->vtx.size(); nIndex++) if (pblock->vtx[nIndex] == *(CTransaction*)this) break; - if (nIndex == pblock->vtx.size()) + if (nIndex == (int)pblock->vtx.size()) { vMerkleBranch.clear(); nIndex = -1; @@ -1079,12 +1086,12 @@ int64 CTransaction::GetValueIn(const MapPrevTx& inputs) const } -int CTransaction::GetP2SHSigOpCount(const MapPrevTx& inputs) const +unsigned int CTransaction::GetP2SHSigOpCount(const MapPrevTx& inputs) const { if (IsCoinBase()) return 0; - int nSigOps = 0; + unsigned int nSigOps = 0; for (unsigned int i = 0; i < vin.size(); i++) { const CTxOut& prevout = GetOutputFor(vin[i], inputs); @@ -1284,7 +1291,7 @@ bool CBlock::ConnectBlock(CTxDB& txdb, CBlockIndex* pindex) map<uint256, CTxIndex> mapQueuedChanges; int64 nFees = 0; - int nSigOps = 0; + unsigned int nSigOps = 0; BOOST_FOREACH(CTransaction& tx, vtx) { nSigOps += tx.GetLegacySigOpCount(); @@ -1645,7 +1652,7 @@ bool CBlock::CheckBlock() const if (!tx.CheckTransaction()) return DoS(tx.nDoS, error("CheckBlock() : CheckTransaction failed")); - int nSigOps = 0; + unsigned int nSigOps = 0; BOOST_FOREACH(const CTransaction& tx, vtx) { nSigOps += tx.GetLegacySigOpCount(); @@ -2583,9 +2590,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) AddOrphanTx(vMsg); // DoS prevention: do not allow mapOrphanTransactions to grow unbounded - int nEvicted = LimitOrphanTxSize(MAX_ORPHAN_TRANSACTIONS); + unsigned int nEvicted = LimitOrphanTxSize(MAX_ORPHAN_TRANSACTIONS); if (nEvicted > 0) - printf("mapOrphan overflow, removed %d tx\n", nEvicted); + printf("mapOrphan overflow, removed %u tx\n", nEvicted); } if (tx.nDoS) pfrom->Misbehaving(tx.nDoS); } @@ -2743,7 +2750,7 @@ bool ProcessMessages(CNode* pfrom) int nHeaderSize = vRecv.GetSerializeSize(CMessageHeader()); if (vRecv.end() - pstart < nHeaderSize) { - if (vRecv.size() > nHeaderSize) + if ((int)vRecv.size() > nHeaderSize) { printf("\n\nPROCESSMESSAGE MESSAGESTART NOT FOUND\n\n"); vRecv.erase(vRecv.begin(), vRecv.end() - nHeaderSize); @@ -3077,7 +3084,7 @@ unsigned int static ScanHash_CryptoPP(char* pmidstate, char* pdata, char* phash1 if ((nNonce & 0xffff) == 0) { nHashesDone = 0xffff+1; - return -1; + return (unsigned int) -1; } } } @@ -3209,7 +3216,7 @@ CBlock* CreateNewBlock(CReserveKey& reservekey) continue; // Legacy limits on sigOps: - int nTxSigOps = tx.GetLegacySigOpCount(); + unsigned int nTxSigOps = tx.GetLegacySigOpCount(); if (nBlockSigOps + nTxSigOps >= MAX_BLOCK_SIGOPS) continue; @@ -3454,7 +3461,7 @@ void static BitcoinMiner(CWallet *pwallet) (char*)&hash, nHashesDone); // Check if something found - if (nNonceFound != -1) + if (nNonceFound != (unsigned int) -1) { for (unsigned int i = 0; i < sizeof(hash)/4; i++) ((unsigned int*)&hash)[i] = ByteReverse(((unsigned int*)&hash)[i]); diff --git a/src/main.h b/src/main.h index a814092ac2..262e77e806 100644 --- a/src/main.h +++ b/src/main.h @@ -28,8 +28,8 @@ class CNode; static const unsigned int MAX_BLOCK_SIZE = 1000000; static const unsigned int MAX_BLOCK_SIZE_GEN = MAX_BLOCK_SIZE/2; -static const int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50; -static const int MAX_ORPHAN_TRANSACTIONS = MAX_BLOCK_SIZE/100; +static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50; +static const unsigned int MAX_ORPHAN_TRANSACTIONS = MAX_BLOCK_SIZE/100; static const int64 MIN_TX_FEE = 50000; static const int64 MIN_RELAY_TX_FEE = 10000; static const int64 MAX_MONEY = 21000000 * COIN; @@ -437,7 +437,7 @@ public: nBlockHeight = nBestHeight; if (nBlockTime == 0) nBlockTime = GetAdjustedTime(); - if ((int64)nLockTime < (nLockTime < LOCKTIME_THRESHOLD ? (int64)nBlockHeight : nBlockTime)) + if ((int64)nLockTime < ((int64)nLockTime < LOCKTIME_THRESHOLD ? (int64)nBlockHeight : nBlockTime)) return true; BOOST_FOREACH(const CTxIn& txin, vin) if (!txin.IsFinal()) @@ -495,7 +495,7 @@ public: @return number of sigops this transaction's outputs will produce when spent @see CTransaction::FetchInputs */ - int GetLegacySigOpCount() const; + unsigned int GetLegacySigOpCount() const; /** Count ECDSA signature operations in pay-to-script-hash inputs. @@ -503,7 +503,7 @@ public: @return maximum number of sigops required to validate this transaction's inputs @see CTransaction::FetchInputs */ - int GetP2SHSigOpCount(const MapPrevTx& mapInputs) const; + unsigned int GetP2SHSigOpCount(const MapPrevTx& mapInputs) const; /** Amount of bitcoins spent by this transaction. @return sum of all outputs (note: does not include fees) @@ -944,9 +944,10 @@ public: fileout << FLATDATA(pchMessageStart) << nSize; // Write block - nBlockPosRet = ftell(fileout); - if (nBlockPosRet == -1) + long fileOutPos = ftell(fileout); + if (fileOutPos < 0) return error("CBlock::WriteToDisk() : ftell failed"); + nBlockPosRet = fileOutPos; fileout << *this; // Flush stdio buffers and commit to disk before returning diff --git a/src/makefile.linux-mingw b/src/makefile.linux-mingw index 1ea65cd2e5..81934187e2 100644 --- a/src/makefile.linux-mingw +++ b/src/makefile.linux-mingw @@ -9,14 +9,14 @@ USE_UPNP:=0 INCLUDEPATHS= \ -I"$(DEPSDIR)/boost_1_47_0" \ -I"$(DEPSDIR)/db-4.8.30.NC/build_unix" \ - -I"$(DEPSDIR)/openssl-1.0.0e/include" \ + -I"$(DEPSDIR)/openssl-1.0.1b/include" \ -I"$(DEPSDIR)" \ -I"$(CURDIR)"/obj \ LIBPATHS= \ -L"$(DEPSDIR)/boost_1_47_0/stage/lib" \ -L"$(DEPSDIR)/db-4.8.30.NC/build_unix" \ - -L"$(DEPSDIR)/openssl-1.0.0e" + -L"$(DEPSDIR)/openssl-1.0.1b" LIBS= \ -l boost_system-mt-s \ @@ -27,10 +27,11 @@ LIBS= \ -l ssl \ -l crypto -DEFS=-D_MT -DWIN32 -D_WINDOWS -DNOPCH -DBOOST_THREAD_USE_LIB +DEFS=-D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB DEBUGFLAGS=-g CFLAGS=-O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS) +TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data) ifdef USE_UPNP LIBPATHS += -L"$(DEPSDIR)/miniupnpc" @@ -78,20 +79,19 @@ obj/%.o: %.cpp $(HEADERS) bitcoind.exe: $(OBJS:obj/%=obj/%) i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) +TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) -obj/test/%.o: obj/test/%.cpp $(HEADERS) - i586-mingw32msvc-g++ -c $(CFLAGS) -o $@ $< +obj-test/%.o: test/%.cpp $(HEADERS) + i586-mingw32msvc-g++ -c $(TESTDEFS) $(CFLAGS) -o $@ $< -test_bitcoin.exe: obj/test/test_bitcoin.o $(filter-out obj/init.o,$(OBJS:obj/%=obj/%)) - i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) -lboost_unit_test_framework-mt-s +test_bitcoin.exe: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%)) + i586-mingw32msvc-g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ -lboost_unit_test_framework $(LIBS) clean: -rm -f obj/*.o - -rm -f obj/test/*.o - -rm -f test/*.o - -rm -f headers.h.gch -rm -f bitcoind.exe + -rm -f obj-test/*.o -rm -f test_bitcoin.exe -rm -f src/build.h diff --git a/src/makefile.mingw b/src/makefile.mingw index 5584df5603..917eb12fcf 100644 --- a/src/makefile.mingw +++ b/src/makefile.mingw @@ -23,10 +23,11 @@ LIBS= \ -l ssl \ -l crypto -DEFS=-DWIN32 -D_WINDOWS -DNOPCH -DBOOST_THREAD_USE_LIB +DEFS=-DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB DEBUGFLAGS=-g CFLAGS=-mthreads -O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS) +TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data) ifdef USE_UPNP INCLUDEPATHS += -I"C:\miniupnpc-1.6-mgw" @@ -71,17 +72,16 @@ obj/%.o: %.cpp $(HEADERS) bitcoind.exe: $(OBJS:obj/%=obj/%) g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) -obj/test/test_bitcoin.o: $(wildcard test/*.cpp) $(HEADERS) - g++ -c $(CFLAGS) -o $@ test/test_bitcoin.cpp +TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) -test_bitcoin.exe: obj/test/test_bitcoin.o $(filter-out obj/init.o,$(OBJS:obj/%=obj/%)) - g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) +obj-test/%.o: test/%.cpp $(HEADERS) + g++ -c $(TESTDEFS) $(CFLAGS) -o $@ $< + +test_bitcoin.exe: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%)) + g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ -lboost_unit_test_framework $(LIBS) clean: -del /Q bitcoind test_bitcoin -del /Q obj\* - -del /Q obj\nogui\* - -del /Q obj\test\* - -del /Q test\*.o - -del /Q headers.h.gch + -del /Q obj-test\* -del /Q build.h diff --git a/src/makefile.osx b/src/makefile.osx index aaac6700bd..be95aab446 100644 --- a/src/makefile.osx +++ b/src/makefile.osx @@ -22,6 +22,9 @@ LIBPATHS= \ USE_UPNP:=1 LIBS= -dead_strip + +TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data) + ifdef STATIC # Build STATIC if you are redistributing the bitcoind binary TESTLIBS += \ diff --git a/src/makefile.unix b/src/makefile.unix index fc901ca02c..90be398976 100644 --- a/src/makefile.unix +++ b/src/makefile.unix @@ -4,11 +4,13 @@ USE_UPNP:=0 -DEFS=-DNOPCH +DEFS= DEFS += $(addprefix -I,$(CURDIR) $(CURDIR)/obj $(BOOST_INCLUDE_PATH) $(BDB_INCLUDE_PATH) $(OPENSSL_INCLUDE_PATH)) LIBS = $(addprefix -L,$(BOOST_LIB_PATH) $(BDB_LIB_PATH) $(OPENSSL_LIB_PATH)) +TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data) + LMODE = dynamic LMODE2 = dynamic ifdef STATIC diff --git a/src/net.cpp b/src/net.cpp index 38c0d3d582..d218dcfb5d 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -498,7 +498,7 @@ void ThreadSocketHandler2(void* parg) { printf("ThreadSocketHandler started\n"); list<CNode*> vNodesDisconnected; - int nPrevNodeCount = 0; + unsigned int nPrevNodeCount = 0; loop { diff --git a/src/obj/nogui/.gitignore b/src/obj/nogui/.gitignore deleted file mode 100644 index d6b7ef32c8..0000000000 --- a/src/obj/nogui/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/src/obj/test/.gitignore b/src/obj/test/.gitignore deleted file mode 100644 index d6b7ef32c8..0000000000 --- a/src/obj/test/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/src/protocol.cpp b/src/protocol.cpp index 06306cf8e1..fda31966f2 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -128,7 +128,7 @@ bool operator<(const CInv& a, const CInv& b) bool CInv::IsKnownType() const { - return (type >= 1 && type < ARRAYLEN(ppszTypeName)); + return (type >= 1 && type < (int)ARRAYLEN(ppszTypeName)); } const char* CInv::GetCommand() const diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index c7830871b5..7c262e14cd 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -168,11 +168,12 @@ int main(int argc, char *argv[]) ParseParameters(argc, argv); // ... then bitcoin.conf: - if (!ReadConfigFile(mapArgs, mapMultiArgs)) + if (!boost::filesystem::is_directory(GetDataDir(false))) { fprintf(stderr, "Error: Specified directory does not exist\n"); return 1; } + ReadConfigFile(mapArgs, mapMultiArgs); // Application identification (must be set before OptionsModel is initialized, // as it is used to locate QSettings) diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 8233e42c25..59c44ac5f9 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -38,6 +38,7 @@ private: QCheckBox *minimize_on_close; #endif QCheckBox *connect_socks4; + QCheckBox *detach_database; QLineEdit *proxy_ip; QLineEdit *proxy_port; BitcoinAmountField *fee_edit; @@ -229,6 +230,10 @@ MainOptionsPage::MainOptionsPage(QWidget *parent): layout->addLayout(fee_hbox); + detach_database = new QCheckBox(tr("Detach databases at shutdown")); + detach_database->setToolTip(tr("Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.")); + layout->addWidget(detach_database); + layout->addStretch(1); // Extra space at bottom setLayout(layout); @@ -256,6 +261,7 @@ void MainOptionsPage::setMapper(MonitoredDataMapper *mapper) mapper->addMapping(proxy_ip, OptionsModel::ProxyIP); mapper->addMapping(proxy_port, OptionsModel::ProxyPort); mapper->addMapping(fee_edit, OptionsModel::Fee); + mapper->addMapping(detach_database, OptionsModel::DetachDatabases); } DisplayOptionsPage::DisplayOptionsPage(QWidget *parent): diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 2210c4dd76..5bba308cf2 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -28,6 +28,8 @@ void OptionsModel::Init() SoftSetBoolArg("-upnp", settings.value("fUseUPnP").toBool()); if (settings.contains("addrProxy") && settings.value("fUseProxy").toBool()) SoftSetArg("-proxy", settings.value("addrProxy").toString().toStdString()); + if (settings.contains("detachDB")) + SoftSetBoolArg("-detachdb", settings.value("detachDB").toBool()); } bool OptionsModel::Upgrade() @@ -121,6 +123,8 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const return QVariant(nDisplayUnit); case DisplayAddresses: return QVariant(bDisplayAddresses); + case DetachDatabases: + return QVariant(fDetachDB); default: return QVariant(); } @@ -204,6 +208,11 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in settings.setValue("bDisplayAddresses", bDisplayAddresses); } break; + case DetachDatabases: { + fDetachDB = value.toBool(); + settings.setValue("detachDB", fDetachDB); + } + break; default: break; } diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index 0be70f8935..da4e86f104 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -26,7 +26,8 @@ public: Fee, // qint64 DisplayUnit, // BitcoinUnits::Unit DisplayAddresses, // bool - OptionIDRowCount + DetachDatabases, // bool + OptionIDRowCount, }; void Init(); diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 7a83f6cefb..a915274da3 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -59,8 +59,6 @@ void WalletModel::update() cachedBalance = newBalance; cachedUnconfirmedBalance = newUnconfirmedBalance; cachedNumTransactions = newNumTransactions; - - addressTableModel->update(); } void WalletModel::updateAddressList() diff --git a/src/script.cpp b/src/script.cpp index fc0a5b3eaa..65e9b7c9a2 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -38,7 +38,7 @@ CBigNum CastToBigNum(const valtype& vch) bool CastToBool(const valtype& vch) { - for (int i = 0; i < vch.size(); i++) + for (unsigned int i = 0; i < vch.size(); i++) { if (vch[i] != 0) { @@ -536,7 +536,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co return false; int n = CastToBigNum(stacktop(-1)).getint(); popstack(stack); - if (n < 0 || n >= stack.size()) + if (n < 0 || n >= (int)stack.size()) return false; valtype vch = stacktop(-n-1); if (opcode == OP_ROLL) @@ -604,9 +604,9 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co int nEnd = nBegin + CastToBigNum(stacktop(-1)).getint(); if (nBegin < 0 || nEnd < nBegin) return false; - if (nBegin > vch.size()) + if (nBegin > (int)vch.size()) nBegin = vch.size(); - if (nEnd > vch.size()) + if (nEnd > (int)vch.size()) nEnd = vch.size(); vch.erase(vch.begin() + nEnd, vch.end()); vch.erase(vch.begin(), vch.begin() + nBegin); @@ -625,7 +625,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co int nSize = CastToBigNum(stacktop(-1)).getint(); if (nSize < 0) return false; - if (nSize > vch.size()) + if (nSize > (int)vch.size()) nSize = vch.size(); if (opcode == OP_LEFT) vch.erase(vch.begin() + nSize, vch.end()); @@ -655,7 +655,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co if (stack.size() < 1) return false; valtype& vch = stacktop(-1); - for (int i = 0; i < vch.size(); i++) + for (unsigned int i = 0; i < vch.size(); i++) vch[i] = ~vch[i]; } break; @@ -672,17 +672,17 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co MakeSameSize(vch1, vch2); if (opcode == OP_AND) { - for (int i = 0; i < vch1.size(); i++) + for (unsigned int i = 0; i < vch1.size(); i++) vch1[i] &= vch2[i]; } else if (opcode == OP_OR) { - for (int i = 0; i < vch1.size(); i++) + for (unsigned int i = 0; i < vch1.size(); i++) vch1[i] |= vch2[i]; } else if (opcode == OP_XOR) { - for (int i = 0; i < vch1.size(); i++) + for (unsigned int i = 0; i < vch1.size(); i++) vch1[i] ^= vch2[i]; } popstack(stack); @@ -1050,7 +1050,7 @@ uint256 SignatureHash(CScript scriptCode, const CTransaction& txTo, unsigned int scriptCode.FindAndDelete(CScript(OP_CODESEPARATOR)); // Blank out other inputs' signatures - for (int i = 0; i < txTmp.vin.size(); i++) + for (unsigned int i = 0; i < txTmp.vin.size(); i++) txTmp.vin[i].scriptSig = CScript(); txTmp.vin[nIn].scriptSig = scriptCode; @@ -1061,7 +1061,7 @@ uint256 SignatureHash(CScript scriptCode, const CTransaction& txTo, unsigned int txTmp.vout.clear(); // Let the others update at will - for (int i = 0; i < txTmp.vin.size(); i++) + for (unsigned int i = 0; i < txTmp.vin.size(); i++) if (i != nIn) txTmp.vin[i].nSequence = 0; } @@ -1075,11 +1075,11 @@ uint256 SignatureHash(CScript scriptCode, const CTransaction& txTo, unsigned int return 1; } txTmp.vout.resize(nOut+1); - for (int i = 0; i < nOut; i++) + for (unsigned int i = 0; i < nOut; i++) txTmp.vout[i].SetNull(); // Let the others update at will - for (int i = 0; i < txTmp.vin.size(); i++) + for (unsigned int i = 0; i < txTmp.vin.size(); i++) if (i != nIn) txTmp.vin[i].nSequence = 0; } @@ -1360,9 +1360,9 @@ bool IsStandard(const CScript& scriptPubKey) } -int HaveKeys(const vector<valtype>& pubkeys, const CKeyStore& keystore) +unsigned int HaveKeys(const vector<valtype>& pubkeys, const CKeyStore& keystore) { - int nResult = 0; + unsigned int nResult = 0; BOOST_FOREACH(const valtype& pubkey, pubkeys) { CBitcoinAddress address; @@ -1449,7 +1449,7 @@ bool ExtractAddresses(const CScript& scriptPubKey, txnouttype& typeRet, vector<C if (typeRet == TX_MULTISIG) { nRequiredRet = vSolutions.front()[0]; - for (int i = 1; i < vSolutions.size()-1; i++) + for (unsigned int i = 1; i < vSolutions.size()-1; i++) { CBitcoinAddress address; address.SetPubKey(vSolutions[i]); @@ -1566,9 +1566,9 @@ bool VerifySignature(const CTransaction& txFrom, const CTransaction& txTo, unsig return true; } -int CScript::GetSigOpCount(bool fAccurate) const +unsigned int CScript::GetSigOpCount(bool fAccurate) const { - int n = 0; + unsigned int n = 0; const_iterator pc = begin(); opcodetype lastOpcode = OP_INVALIDOPCODE; while (pc < end()) @@ -1590,7 +1590,7 @@ int CScript::GetSigOpCount(bool fAccurate) const return n; } -int CScript::GetSigOpCount(const CScript& scriptSig) const +unsigned int CScript::GetSigOpCount(const CScript& scriptSig) const { if (!IsPayToScriptHash()) return GetSigOpCount(true); diff --git a/src/script.h b/src/script.h index b13734be41..e41e09b6b3 100644 --- a/src/script.h +++ b/src/script.h @@ -467,7 +467,7 @@ public: opcodetype opcode; do { - while (end() - pc >= b.size() && memcmp(&pc[0], &b[0], b.size()) == 0) + while (end() - pc >= (long)b.size() && memcmp(&pc[0], &b[0], b.size()) == 0) { erase(pc, pc + b.size()); ++nFound; @@ -491,11 +491,11 @@ public: // CHECKMULTISIGs serialized in scriptSigs are // counted more accurately, assuming they are of the form // ... OP_N CHECKMULTISIG ... - int GetSigOpCount(bool fAccurate) const; + unsigned int GetSigOpCount(bool fAccurate) const; // Accurately count sigOps, including sigOps in // pay-to-script-hash transactions: - int GetSigOpCount(const CScript& scriptSig) const; + unsigned int GetSigOpCount(const CScript& scriptSig) const; bool IsPayToScriptHash() const; diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp index c0b00102a0..e5a8b4f68b 100644 --- a/src/test/DoS_tests.cpp +++ b/src/test/DoS_tests.cpp @@ -14,7 +14,7 @@ // Tests this internal-to-main.cpp method: extern void AddOrphanTx(const CDataStream& vMsg); -extern int LimitOrphanTxSize(int nMaxOrphans); +extern unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans); extern std::map<uint256, CDataStream*> mapOrphanTransactions; extern std::multimap<uint256, CDataStream*> mapOrphanTransactionsByPrev; diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index 988bd24de8..745df4bd7b 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -5,8 +5,9 @@ #include <boost/algorithm/string/predicate.hpp> #include <boost/algorithm/string/replace.hpp> #include <boost/algorithm/string/split.hpp> -#include <boost/test/unit_test.hpp> #include <boost/foreach.hpp> +#include <boost/preprocessor/stringize.hpp> +#include <boost/test/unit_test.hpp> #include "json/json_spirit_reader_template.h" #include "json/json_spirit_writer_template.h" #include "json/json_spirit_utils.h" @@ -87,10 +88,13 @@ read_json(const std::string& filename) { namespace fs = boost::filesystem; fs::path testFile = fs::current_path() / "test" / "data" / filename; + +#ifdef TEST_DATA_DIR if (!fs::exists(testFile)) { - fs::path testFile = fs::path(__FILE__).parent_path() / "data" / filename; + testFile = fs::path(BOOST_PP_STRINGIZE(TEST_DATA_DIR)) / filename; } +#endif ifstream ifs(testFile.string().c_str(), ifstream::in); Value v; diff --git a/src/util.cpp b/src/util.cpp index 9f2de3449d..cd3d3b94a9 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -283,7 +283,7 @@ int my_snprintf(char* buffer, size_t limit, const char* format, ...) va_start(arg_ptr, format); int ret = _vsnprintf(buffer, limit, format, arg_ptr); va_end(arg_ptr); - if (ret < 0 || ret >= limit) + if (ret < 0 || ret >= (int)limit) { ret = limit - 1; buffer[limit-1] = 0; @@ -870,7 +870,11 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific) LOCK(csPathCached); if (mapArgs.count("-datadir")) { - path = mapArgs["-datadir"]; + path = fs::system_complete(mapArgs["-datadir"]); + if (!fs::is_directory(path)) { + path = ""; + return path; + } } else { path = GetDefaultDataDir(); } @@ -892,7 +896,7 @@ boost::filesystem::path GetConfigFile() return pathConfigFile; } -bool ReadConfigFile(map<string, string>& mapSettingsRet, +void ReadConfigFile(map<string, string>& mapSettingsRet, map<string, vector<string> >& mapMultiSettingsRet) { namespace fs = boost::filesystem; @@ -900,7 +904,7 @@ bool ReadConfigFile(map<string, string>& mapSettingsRet, fs::ifstream streamConfig(GetConfigFile()); if (!streamConfig.good()) - return true; // No bitcoin.conf file is OK + return; // No bitcoin.conf file is OK set<string> setOptions; setOptions.insert("*"); @@ -917,7 +921,6 @@ bool ReadConfigFile(map<string, string>& mapSettingsRet, } mapMultiSettingsRet[strKey].push_back(it->value[0]); } - return true; } boost::filesystem::path GetPidFile() diff --git a/src/util.h b/src/util.h index fe8ca60b47..6c3e6c5450 100644 --- a/src/util.h +++ b/src/util.h @@ -162,7 +162,7 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific = true); boost::filesystem::path GetConfigFile(); boost::filesystem::path GetPidFile(); void CreatePidFile(const boost::filesystem::path &path, pid_t pid); -bool ReadConfigFile(std::map<std::string, std::string>& mapSettingsRet, std::map<std::string, std::vector<std::string> >& mapMultiSettingsRet); +void ReadConfigFile(std::map<std::string, std::string>& mapSettingsRet, std::map<std::string, std::vector<std::string> >& mapMultiSettingsRet); bool GetStartOnSystemStartup(); bool SetStartOnSystemStartup(bool fAutoStart); void ShrinkDebugFile(); @@ -579,9 +579,9 @@ template <typename T> class CMedianFilter private: std::vector<T> vValues; std::vector<T> vSorted; - int nSize; + unsigned int nSize; public: - CMedianFilter(int size, T initial_value): + CMedianFilter(unsigned int size, T initial_value): nSize(size) { vValues.reserve(size); diff --git a/src/version.h b/src/version.h index f63b1bdadd..e8d5b5c421 100644 --- a/src/version.h +++ b/src/version.h @@ -12,8 +12,8 @@ static const int CLIENT_VERSION_MAJOR = 0; static const int CLIENT_VERSION_MINOR = 6; -static const int CLIENT_VERSION_REVISION = 0; -static const int CLIENT_VERSION_BUILD = 99; +static const int CLIENT_VERSION_REVISION = 1; +static const int CLIENT_VERSION_BUILD = 1; static const int CLIENT_VERSION = 1000000 * CLIENT_VERSION_MAJOR diff --git a/src/wallet.cpp b/src/wallet.cpp index 53836be0cd..998909897f 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1391,8 +1391,8 @@ bool CWallet::TopUpKeyPool() CWalletDB walletdb(strWalletFile); // Top up key pool - int64 nTargetSize = max(GetArg("-keypool", 100), (int64)0); - while (setKeyPool.size() < nTargetSize+1) + unsigned int nTargetSize = max(GetArg("-keypool", 100), 0LL); + while (setKeyPool.size() < (nTargetSize + 1)) { int64 nEnd = 1; if (!setKeyPool.empty()) |