diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2012-06-19 16:34:10 -0400 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2012-06-19 16:34:10 -0400 |
commit | 23e7583a8c9a0dcee9cbbf3be8bfc453298773f0 (patch) | |
tree | 08a6b8dde07dfd356497975d89c3dac3922d3cd7 | |
parent | b90b8159db929232b7142baa903ddc0226dd7e10 (diff) | |
parent | 5e322a72f94e3c759bb37cec37d8c066766b6072 (diff) |
Merge branch '0.6.x' of git://gitorious.org/+bitcoin-stable-developers/bitcoin/bitcoind-stable into 0.6.3
67 files changed, 200 insertions, 130 deletions
diff --git a/.gitignore b/.gitignore index dafbc2b6bc..2b70e2cca5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ src/*.exe src/bitcoin src/bitcoind +src/test_bitcoin src/build.h .*.swp *.*~* @@ -20,3 +21,4 @@ qrc_*.cpp *.pro.user #mac specific .DS_Store +build diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro index 07f5a6114b..7f2a5a46be 100644 --- a/bitcoin-qt.pro +++ b/bitcoin-qt.pro @@ -83,7 +83,7 @@ contains(BITCOIN_NEED_QT_PLUGINS, 1) { # regenerate src/build.h !windows || contains(USE_BUILD_INFO, 1) { genbuild.depends = FORCE - genbuild.commands = cd $$PWD; share/genbuild.sh $$OUT_PWD/build/build.h + genbuild.commands = cd $$PWD; /bin/sh share/genbuild.sh $$OUT_PWD/build/build.h genbuild.target = genbuildhook PRE_TARGETDEPS += genbuildhook QMAKE_EXTRA_TARGETS += genbuild diff --git a/contrib/debian/control b/contrib/debian/control index 745fd71ea8..b81c02ec1a 100644 --- a/contrib/debian/control +++ b/contrib/debian/control @@ -35,7 +35,7 @@ Description: peer-to-peer network based digital currency - daemon By default connects to an IRC network to discover other peers. . Full transaction history is stored locally at each client. This - requires 150+ MB of space, slowly growing. + requires 2+ GB of space, slowly growing. . This package provides bitcoind, a combined daemon and CLI tool to interact with the daemon. @@ -53,6 +53,6 @@ Description: peer-to-peer network based digital currency - QT GUI By default connects to an IRC network to discover other peers. . Full transaction history is stored locally at each client. This - requires 150+ MB of space, slowly growing. + requires 2+ GB of space, slowly growing. . This package provides bitcoin-qt, a GUI for Bitcoin based on QT. diff --git a/contrib/gitian-descriptors/gitian-win32.yml b/contrib/gitian-descriptors/gitian-win32.yml index 9752626d6a..a48e54da85 100644 --- a/contrib/gitian-descriptors/gitian-win32.yml +++ b/contrib/gitian-descriptors/gitian-win32.yml @@ -12,7 +12,7 @@ packages: - "faketime" reference_datetime: "2011-01-30 00:00:00" remotes: -- "url": "https://github.com/bitcoin/bitcoin.git" +- "url": "https://git.gitorious.org/+bitcoin-stable-developers/bitcoin/bitcoind-stable.git" "dir": "bitcoin" files: - "qt-win32-4.7.4-gitian.zip" diff --git a/contrib/gitian-descriptors/gitian.yml b/contrib/gitian-descriptors/gitian.yml index 8243c5c301..36a2000551 100644 --- a/contrib/gitian-descriptors/gitian.yml +++ b/contrib/gitian-descriptors/gitian.yml @@ -20,7 +20,7 @@ packages: - "libpng12-dev" reference_datetime: "2011-01-30 00:00:00" remotes: -- "url": "https://github.com/bitcoin/bitcoin.git" +- "url": "https://git.gitorious.org/+bitcoin-stable-developers/bitcoin/bitcoind-stable.git" "dir": "bitcoin" files: - "miniupnpc-1.6.tar.gz" diff --git a/contrib/gitian-downloader/linux-download-config b/contrib/gitian-downloader/linux-download-config index 88e48e2c23..aef614d0ca 100644 --- a/contrib/gitian-downloader/linux-download-config +++ b/contrib/gitian-downloader/linux-download-config @@ -31,7 +31,7 @@ signers: weight: 40 name: "Gavin Andresen" key: gavinandresen - 71A3B16735405025D447E8F274810B012346C9A6 + 71A3B16735405025D447E8F274810B012346C9A6: weight: 40 name: "Wladimir J. van der Laan" key: laanwj diff --git a/contrib/gitian-downloader/win32-download-config b/contrib/gitian-downloader/win32-download-config index 595626f28f..0f7032e643 100644 --- a/contrib/gitian-downloader/win32-download-config +++ b/contrib/gitian-downloader/win32-download-config @@ -31,7 +31,7 @@ signers: weight: 40 name: "Gavin Andresen" key: gavinandresen - 71A3B16735405025D447E8F274810B012346C9A6 + 71A3B16735405025D447E8F274810B012346C9A6: weight: 40 name: "Wladimir J. van der Laan" key: laanwj diff --git a/doc/build-unix.txt b/doc/build-unix.txt index c5b4205084..f93ddcd969 100644 --- a/doc/build-unix.txt +++ b/doc/build-unix.txt @@ -33,14 +33,14 @@ Dependencies miniupnpc may be used for UPnP port mapping. It can be downloaded from http://miniupnp.tuxfamily.org/files/. UPnP support is compiled in and turned off by default. Set USE_UPNP to a different value to control this: - USE_UPNP= No UPnP support - miniupnp not required + USE_UPNP=- No UPnP support - miniupnp not required USE_UPNP=0 (the default) UPnP support turned off by default at runtime USE_UPNP=1 UPnP support turned on by default at runtime libqrencode may be used for QRCode image generation. It can be downloaded from http://fukuchi.org/works/qrencode/index.html.en, or installed via your package manager. Set USE_QRCODE to control this: - USE_QRCODE=0 (the default) No QRCode support - libarcode not required + USE_QRCODE=0 (the default) No QRCode support - libqrcode not required USE_QRCODE=1 QRCode support enabled Licenses of statically linked libraries: diff --git a/doc/release-process.txt b/doc/release-process.txt index 00fafa4818..ed23ef3505 100644 --- a/doc/release-process.txt +++ b/doc/release-process.txt @@ -98,6 +98,8 @@ * update wiki download links +* update wiki changelog: https://en.bitcoin.it/wiki/Changelog + * Commit your signature to gitian.sigs: pushd gitian.sigs git add ${VERSION}/${SIGNER} diff --git a/src/addrman.cpp b/src/addrman.cpp index 10d005aae9..8257a46a15 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2012 Pieter Wuille // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "addrman.h" diff --git a/src/addrman.h b/src/addrman.h index 3768614cfe..aa42025c07 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -1,6 +1,6 @@ // Copyright (c) 2012 Pieter Wuille // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef _BITCOIN_ADDRMAN #define _BITCOIN_ADDRMAN 1 diff --git a/src/allocators.h b/src/allocators.h index fa9534bc52..ddeabc48c5 100644 --- a/src/allocators.h +++ b/src/allocators.h @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_ALLOCATORS_H #define BITCOIN_ALLOCATORS_H @@ -117,7 +117,6 @@ struct zero_after_free_allocator : public std::allocator<T> }; // This is exactly like std::string, but with a custom allocator. -// (secure_allocator<> is defined in serialize.h) typedef std::basic_string<char, std::char_traits<char>, secure_allocator<char> > SecureString; #endif diff --git a/src/base58.h b/src/base58.h index 90ce34b05b..bc681a08ca 100644 --- a/src/base58.h +++ b/src/base58.h @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin Developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. // diff --git a/src/bignum.h b/src/bignum.h index f0971e8850..307017b0ab 100644 --- a/src/bignum.h +++ b/src/bignum.h @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_BIGNUM_H #define BITCOIN_BIGNUM_H diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 15bcf1da3d..3553f81b45 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -1,7 +1,7 @@ // Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "main.h" #include "wallet.h" @@ -225,7 +225,7 @@ Value stop(const Array& params, bool fHelp) "stop\n" "Stop bitcoin server."); // Shutdown will take long enough that the response should get back - QueueShutdown(); + StartShutdown(); return "bitcoin server stopping"; } @@ -839,7 +839,8 @@ Value movecmd(const Array& params, bool fHelp) strComment = params[4].get_str(); CWalletDB walletdb(pwalletMain->strWalletFile); - walletdb.TxnBegin(); + if (!walletdb.TxnBegin()) + throw JSONRPCError(-20, "database error"); int64 nNow = GetAdjustedTime(); @@ -861,7 +862,8 @@ Value movecmd(const Array& params, bool fHelp) credit.strComment = strComment; walletdb.WriteAccountingEntry(credit); - walletdb.TxnCommit(); + if (!walletdb.TxnCommit()) + throw JSONRPCError(-20, "database error"); return true; } @@ -999,10 +1001,12 @@ Value addmultisigaddress(const Array& params, bool fHelp) strAccount = AccountFromValue(params[2]); // Gather public keys - if ((nRequired < 1) || ((int)keys.size() < nRequired)) + if (nRequired < 1) + throw runtime_error("a multisignature address must require at least one key to redeem"); + if ((int)keys.size() < nRequired) throw runtime_error( - strprintf("wrong number of keys" - "(got %d, need at least %d)", keys.size(), nRequired)); + strprintf("not enough keys supplied " + "(got %d keys, but need at least %d to redeem)", keys.size(), nRequired)); std::vector<CKey> pubkeys; pubkeys.resize(keys.size()); for (unsigned int i = 0; i < keys.size(); i++) @@ -1703,7 +1707,7 @@ Value encryptwallet(const Array& params, bool fHelp) // BDB seems to have a bad habit of writing old data into // slack space in .dat files; that is bad if the old data is // unencrypted private keys. So: - QueueShutdown(); + StartShutdown(); return "wallet encrypted; bitcoin server stopping, restart to run with encrypted wallet"; } @@ -2376,7 +2380,7 @@ void ThreadRPCServer2(void* parg) GetConfigFile().string().c_str(), EncodeBase58(&rand_pwd[0],&rand_pwd[0]+32).c_str()), _("Error"), wxOK | wxMODAL); - QueueShutdown(); + StartShutdown(); return; } @@ -2397,7 +2401,7 @@ void ThreadRPCServer2(void* parg) { ThreadSafeMessageBox(strprintf(_("An error occured while setting up the RPC port %i for listening: %s"), endpoint.port(), e.what()), _("Error"), wxOK | wxMODAL); - QueueShutdown(); + StartShutdown(); return; } diff --git a/src/bitcoinrpc.h b/src/bitcoinrpc.h index 6b7293ed19..f8216867b6 100644 --- a/src/bitcoinrpc.h +++ b/src/bitcoinrpc.h @@ -1,7 +1,7 @@ // Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef _BITCOINRPC_H_ #define _BITCOINRPC_H_ 1 diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp index 21d3ce774e..67e2c4cb78 100644 --- a/src/checkpoints.cpp +++ b/src/checkpoints.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <boost/assign/list_of.hpp> // for 'map_list_of()' #include <boost/foreach.hpp> diff --git a/src/checkpoints.h b/src/checkpoints.h index 5d3228f3fc..70e936564c 100644 --- a/src/checkpoints.h +++ b/src/checkpoints.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_CHECKPOINT_H #define BITCOIN_CHECKPOINT_H diff --git a/src/compat.h b/src/compat.h index 804a8141b5..79ebb9323a 100644 --- a/src/compat.h +++ b/src/compat.h @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef _BITCOIN_COMPAT_H #define _BITCOIN_COMPAT_H 1 diff --git a/src/db.cpp b/src/db.cpp index f9151f7f92..c67a34c39e 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "db.h" #include "util.h" @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_DB_H #define BITCOIN_DB_H diff --git a/src/init.cpp b/src/init.cpp index 3fe6d1b091..281a8cae56 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "db.h" #include "walletdb.h" #include "bitcoinrpc.h" @@ -36,6 +36,17 @@ void ExitTimeout(void* parg) #endif } +void StartShutdown() +{ +#ifdef QT_GUI + // ensure we leave the Qt main loop for a clean GUI exit (Shutdown() is called in bitcoin.cpp afterwards) + QueueShutdown(); +#else + // Without UI, Shutdown() can simply be started in a new thread + CreateThread(Shutdown, NULL); +#endif +} + void Shutdown(void* parg) { static CCriticalSection cs_Shutdown; @@ -64,7 +75,10 @@ void Shutdown(void* parg) Sleep(50); printf("Bitcoin exiting\n\n"); fExit = true; +#ifndef QT_GUI + // ensure non UI client get's exited here, but let Bitcoin-Qt reach return 0; in bitcoin.cpp exit(0); +#endif } else { diff --git a/src/init.h b/src/init.h index e3971c85e3..cc276a2bf3 100644 --- a/src/init.h +++ b/src/init.h @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_INIT_H #define BITCOIN_INIT_H @@ -9,11 +9,9 @@ extern CWallet* pwalletMain; +void StartShutdown(); void Shutdown(void* parg); bool AppInit(int argc, char* argv[]); bool AppInit2(int argc, char* argv[]); -bool GetStartOnSystemStartup(); -bool SetStartOnSystemStartup(bool fAutoStart); - #endif diff --git a/src/irc.cpp b/src/irc.cpp index 237497055d..d8129c6113 100644 --- a/src/irc.cpp +++ b/src/irc.cpp @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "irc.h" #include "net.h" @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_IRC_H #define BITCOIN_IRC_H diff --git a/src/key.cpp b/src/key.cpp index b6c3f28688..18b4672043 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <map> @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_KEY_H #define BITCOIN_KEY_H diff --git a/src/keystore.cpp b/src/keystore.cpp index 313518711b..3cb95767bb 100644 --- a/src/keystore.cpp +++ b/src/keystore.cpp @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "keystore.h" #include "script.h" diff --git a/src/keystore.h b/src/keystore.h index 76820e204b..3f1f0ce9dd 100644 --- a/src/keystore.h +++ b/src/keystore.h @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_KEYSTORE_H #define BITCOIN_KEYSTORE_H diff --git a/src/main.cpp b/src/main.cpp index 7d2fbd5c41..9a7ff16841 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,7 +1,8 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + #include "checkpoints.h" #include "db.h" #include "net.h" @@ -1513,7 +1514,9 @@ bool CBlock::SetBestChain(CTxDB& txdb, CBlockIndex* pindexNew) { uint256 hash = GetHash(); - txdb.TxnBegin(); + if (!txdb.TxnBegin()) + return error("SetBestChain() : TxnBegin failed"); + if (pindexGenesisBlock == NULL && hash == hashGenesisBlock) { txdb.WriteHashBestChain(hash); @@ -1562,7 +1565,10 @@ bool CBlock::SetBestChain(CTxDB& txdb, CBlockIndex* pindexNew) printf("SetBestChain() : ReadFromDisk failed\n"); break; } - txdb.TxnBegin(); + if (!txdb.TxnBegin()) { + printf("SetBestChain() : TxnBegin 2 failed\n"); + break; + } // errors now are not fatal, we still did a reorganisation to a new chain in a valid way if (!block.SetBestChainInner(txdb, pindex)) break; @@ -1620,7 +1626,8 @@ bool CBlock::AddToBlockIndex(unsigned int nFile, unsigned int nBlockPos) pindexNew->bnChainWork = (pindexNew->pprev ? pindexNew->pprev->bnChainWork : 0) + pindexNew->GetBlockWork(); CTxDB txdb; - txdb.TxnBegin(); + if (!txdb.TxnBegin()) + return false; txdb.WriteBlockIndex(CDiskBlockIndex(pindexNew)); if (!txdb.TxnCommit()) return false; @@ -1848,11 +1855,11 @@ bool CheckDiskSpace(uint64 nAdditionalBytes) if (nFreeBytesAvailable < (uint64)15000000 + nAdditionalBytes) { fShutdown = true; - string strMessage = _("Warning: Disk space is low "); + string strMessage = _("Warning: Disk space is low"); strMiscWarning = strMessage; printf("*** %s\n", strMessage.c_str()); ThreadSafeMessageBox(strMessage, "Bitcoin", wxOK | wxICON_EXCLAMATION | wxMODAL); - QueueShutdown(); + StartShutdown(); return false; } return true; @@ -2415,6 +2422,14 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) return error("message inv size() = %d", vInv.size()); } + // find last block in inv vector + unsigned int nLastBlock = (unsigned int)(-1); + for (unsigned int nInv = 0; nInv < vInv.size(); nInv++) { + if (vInv[vInv.size() - 1 - nInv].type == MSG_BLOCK) { + nLastBlock = vInv.size() - 1 - nInv; + break; + } + } CTxDB txdb("r"); for (unsigned int nInv = 0; nInv < vInv.size(); nInv++) { @@ -2428,13 +2443,19 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) if (fDebug) printf(" got inventory: %s %s\n", inv.ToString().c_str(), fAlreadyHave ? "have" : "new"); - // Always request the last block in an inv bundle (even if we already have it), as it is the - // trigger for the other side to send further invs. If we are stuck on a (very long) side chain, - // this is necessary to connect earlier received orphan blocks to the chain again. - if (!fAlreadyHave || (inv.type == MSG_BLOCK && nInv==vInv.size()-1)) + if (!fAlreadyHave) pfrom->AskFor(inv); - if (inv.type == MSG_BLOCK && mapOrphanBlocks.count(inv.hash)) + else if (inv.type == MSG_BLOCK && mapOrphanBlocks.count(inv.hash)) { pfrom->PushGetBlocks(pindexBest, GetOrphanRoot(mapOrphanBlocks[inv.hash])); + } else if (nInv == nLastBlock) { + // In case we are on a very long side-chain, it is possible that we already have + // the last block in an inv bundle sent in response to getblocks. Try to detect + // this situation and push another getblocks to continue. + std::vector<CInv> vGetData(1,inv); + pfrom->PushGetBlocks(mapBlockIndex[inv.hash], uint256(0)); + if (fDebug) + printf("force request: %s\n", inv.ToString().c_str()); + } // Track requests for our stuff Inventory(inv.hash); @@ -2819,7 +2840,7 @@ bool ProcessMessages(CNode* pfrom) unsigned int nMessageSize = hdr.nMessageSize; if (nMessageSize > MAX_SIZE) { - printf("ProcessMessage(%s, %u bytes) : nMessageSize > MAX_SIZE\n", strCommand.c_str(), nMessageSize); + printf("ProcessMessages(%s, %u bytes) : nMessageSize > MAX_SIZE\n", strCommand.c_str(), nMessageSize); continue; } if (nMessageSize > vRecv.size()) @@ -2835,7 +2856,7 @@ bool ProcessMessages(CNode* pfrom) memcpy(&nChecksum, &hash, sizeof(nChecksum)); if (nChecksum != hdr.nChecksum) { - printf("ProcessMessage(%s, %u bytes) : CHECKSUM ERROR nChecksum=%08x hdr.nChecksum=%08x\n", + printf("ProcessMessages(%s, %u bytes) : CHECKSUM ERROR nChecksum=%08x hdr.nChecksum=%08x\n", strCommand.c_str(), nMessageSize, nChecksum, hdr.nChecksum); continue; } @@ -2860,22 +2881,22 @@ bool ProcessMessages(CNode* pfrom) if (strstr(e.what(), "end of data")) { // Allow exceptions from underlength message on vRecv - printf("ProcessMessage(%s, %u bytes) : Exception '%s' caught, normally caused by a message being shorter than its stated length\n", strCommand.c_str(), nMessageSize, e.what()); + printf("ProcessMessages(%s, %u bytes) : Exception '%s' caught, normally caused by a message being shorter than its stated length\n", strCommand.c_str(), nMessageSize, e.what()); } else if (strstr(e.what(), "size too large")) { // Allow exceptions from overlong size - printf("ProcessMessage(%s, %u bytes) : Exception '%s' caught\n", strCommand.c_str(), nMessageSize, e.what()); + printf("ProcessMessages(%s, %u bytes) : Exception '%s' caught\n", strCommand.c_str(), nMessageSize, e.what()); } else { - PrintExceptionContinue(&e, "ProcessMessage()"); + PrintExceptionContinue(&e, "ProcessMessages()"); } } catch (std::exception& e) { - PrintExceptionContinue(&e, "ProcessMessage()"); + PrintExceptionContinue(&e, "ProcessMessages()"); } catch (...) { - PrintExceptionContinue(NULL, "ProcessMessage()"); + PrintExceptionContinue(NULL, "ProcessMessages()"); } if (!fRet) @@ -3222,7 +3243,7 @@ CBlock* CreateNewBlock(CReserveKey& reservekey) dPriority += (double)nValueIn * nConf; if (fDebug && GetBoolArg("-printpriority")) - printf("priority nValueIn=%-12I64d nConf=%-5d dPriority=%-20.1f\n", nValueIn, nConf, dPriority); + printf("priority nValueIn=%-12"PRI64d" nConf=%-5d dPriority=%-20.1f\n", nValueIn, nConf, dPriority); } // Priority is sum(valuein * age) / txsize diff --git a/src/main.h b/src/main.h index 96187d3c5f..241ef46c8f 100644 --- a/src/main.h +++ b/src/main.h @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_MAIN_H #define BITCOIN_MAIN_H diff --git a/src/makefile.linux-mingw b/src/makefile.linux-mingw index abc014c2c4..960716c147 100644 --- a/src/makefile.linux-mingw +++ b/src/makefile.linux-mingw @@ -69,7 +69,7 @@ OBJS= \ all: bitcoind.exe obj/build.h: FORCE - ../share/genbuild.sh obj/build.h + /bin/sh ../share/genbuild.sh obj/build.h version.cpp: obj/build.h DEFS += -DHAVE_BUILD_INFO diff --git a/src/makefile.mingw b/src/makefile.mingw index 6bfef0b9e7..37201e3621 100644 --- a/src/makefile.mingw +++ b/src/makefile.mingw @@ -7,12 +7,12 @@ USE_UPNP:=0 INCLUDEPATHS= \ -I"C:\boost-1.47.0-mgw" \ -I"C:\db-4.8.30.NC-mgw\build_unix" \ - -I"C:\openssl-1.0.0d-mgw\include" + -I"C:\openssl-1.0.1b-mgw\include" LIBPATHS= \ -L"C:\boost-1.47.0-mgw\stage\lib" \ -L"C:\db-4.8.30.NC-mgw\build_unix" \ - -L"C:\openssl-1.0.0d-mgw" + -L"C:\openssl-1.0.1b-mgw" LIBS= \ -l boost_system-mgw45-mt-s-1_47 \ diff --git a/src/makefile.osx b/src/makefile.osx index 312b6c23ec..11c6248767 100644 --- a/src/makefile.osx +++ b/src/makefile.osx @@ -106,7 +106,7 @@ all: bitcoind -include obj-test/*.P obj/build.h: FORCE - ../share/genbuild.sh obj/build.h + /bin/sh ../share/genbuild.sh obj/build.h version.cpp: obj/build.h DEFS += -DHAVE_BUILD_INFO diff --git a/src/makefile.unix b/src/makefile.unix index d00c12b27d..58331cacce 100644 --- a/src/makefile.unix +++ b/src/makefile.unix @@ -116,7 +116,7 @@ all: bitcoind -include obj-test/*.P obj/build.h: FORCE - ../share/genbuild.sh obj/build.h + /bin/sh ../share/genbuild.sh obj/build.h version.cpp: obj/build.h DEFS += -DHAVE_BUILD_INFO diff --git a/src/mruset.h b/src/mruset.h index b21f18563c..ad2e160d3a 100644 --- a/src/mruset.h +++ b/src/mruset.h @@ -1,6 +1,6 @@ // Copyright (c) 2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_MRUSET_H #define BITCOIN_MRUSET_H diff --git a/src/net.cpp b/src/net.cpp index 88a3b436c7..d3236b341c 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "irc.h" #include "db.h" @@ -609,7 +609,7 @@ void ThreadSocketHandler2(void* parg) if (nSelect == SOCKET_ERROR) { int nErr = WSAGetLastError(); - if (hSocketMax > -1) + if (hSocketMax != INVALID_SOCKET) { printf("socket select error %d\n", nErr); for (unsigned int i = 0; i <= hSocketMax; i++) @@ -1477,7 +1477,7 @@ void ThreadMessageHandler2(void* parg) vnThreadsRunning[THREAD_MESSAGEHANDLER]--; Sleep(100); if (fRequestShutdown) - Shutdown(NULL); + StartShutdown(); vnThreadsRunning[THREAD_MESSAGEHANDLER]++; if (fShutdown) return; @@ -1703,8 +1703,9 @@ bool StopNode() fShutdown = true; nTransactionsUpdated++; int64 nStart = GetTime(); - for (int i=0; i<MAX_OUTBOUND_CONNECTIONS; i++) - semOutbound->post(); + if (semOutbound) + for (int i=0; i<MAX_OUTBOUND_CONNECTIONS; i++) + semOutbound->post(); do { int nThreadsRunning = 0; @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_NET_H #define BITCOIN_NET_H diff --git a/src/netbase.cpp b/src/netbase.cpp index 8b30ffc140..6cb8aa8b9c 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "netbase.h" #include "util.h" diff --git a/src/netbase.h b/src/netbase.h index 00b6850b2a..5bf3fdd2d2 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -1,6 +1,6 @@ // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_NETBASE_H #define BITCOIN_NETBASE_H diff --git a/src/noui.cpp b/src/noui.cpp index 08a08b439a..6d984680b1 100644 --- a/src/noui.cpp +++ b/src/noui.cpp @@ -1,7 +1,7 @@ // Copyright (c) 2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "ui_interface.h" #include <string> diff --git a/src/protocol.cpp b/src/protocol.cpp index fda31966f2..d6e340e366 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "protocol.h" #include "util.h" diff --git a/src/protocol.h b/src/protocol.h index f7331c1923..b516f1b897 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef __cplusplus # error This header can only be compiled as C++. diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp index 3e55c39e04..02454c5af3 100644 --- a/src/qt/addressbookpage.cpp +++ b/src/qt/addressbookpage.cpp @@ -123,11 +123,6 @@ void AddressBookPage::setModel(AddressTableModel *model) connect(ui->tableView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(selectionChanged())); - if(mode == ForSending) - { - // Auto-select first row when in sending mode - ui->tableView->selectRow(0); - } selectionChanged(); } diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 7c262e14cd..b4f418e2b8 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -281,12 +281,14 @@ int main(int argc, char *argv[]) #endif app.exec(); + window.hide(); window.setClientModel(0); window.setWalletModel(0); guiref = 0; clientmodel = 0; walletmodel = 0; } + // Shutdown the core and it's threads, but don't exit Bitcoin-Qt here Shutdown(NULL); } else diff --git a/src/qt/bitcoinaddressvalidator.cpp b/src/qt/bitcoinaddressvalidator.cpp index 373877808f..c804ad0d57 100644 --- a/src/qt/bitcoinaddressvalidator.cpp +++ b/src/qt/bitcoinaddressvalidator.cpp @@ -21,9 +21,12 @@ BitcoinAddressValidator::BitcoinAddressValidator(QObject *parent) : QValidator::State BitcoinAddressValidator::validate(QString &input, int &pos) const { // Correction - for(int idx=0; idx<input.size(); ++idx) + for(int idx=0; idx<input.size();) { - switch(input.at(idx).unicode()) + bool removeChar = false; + QChar ch = input.at(idx); + // Transform characters that are visually close + switch(ch.unicode()) { case 'l': case 'I': @@ -33,9 +36,22 @@ QValidator::State BitcoinAddressValidator::validate(QString &input, int &pos) co case 'O': input[idx] = QChar('o'); break; + // Qt categorizes these as "Other_Format" not "Separator_Space" + case 0x200B: // ZERO WIDTH SPACE + case 0xFEFF: // ZERO WIDTH NO-BREAK SPACE + removeChar = true; + break; default: break; } + // Remove whitespace + if(ch.isSpace()) + removeChar = true; + // To next character + if(removeChar) + input.remove(idx, 1); + else + ++idx; } // Validation diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index bcf90917ed..fd31d3c5fe 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -1,8 +1,8 @@ /* * Qt4 bitcoin GUI. * - * W.J. van der Laan 20011-2012 - * The Bitcoin Developers 20011-2012 + * W.J. van der Laan 2011-2012 + * The Bitcoin Developers 2011-2012 */ #include "bitcoingui.h" #include "transactiontablemodel.h" @@ -163,8 +163,6 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): BitcoinGUI::~BitcoinGUI() { - if(trayIcon) // Hide tray icon, as deleting will let it linger until quit (on Ubuntu) - trayIcon->hide(); #ifdef Q_WS_MAC delete appMenuBar; #endif @@ -385,7 +383,6 @@ void BitcoinGUI::createTrayIcon() #else // Note: On Mac, the dock icon is used to provide the tray's functionality. MacDockIconHandler *dockIconHandler = MacDockIconHandler::instance(); - connect(dockIconHandler, SIGNAL(dockIconClicked()), toggleHideAction, SLOT(trigger())); trayIconMenu = dockIconHandler->dockMenu(); #endif diff --git a/src/qt/csvmodelwriter.cpp b/src/qt/csvmodelwriter.cpp index 84578b3322..8a50bbab3f 100644 --- a/src/qt/csvmodelwriter.cpp +++ b/src/qt/csvmodelwriter.cpp @@ -27,8 +27,9 @@ void CSVModelWriter::addColumn(const QString &title, int column, int role) static void writeValue(QTextStream &f, const QString &value) { - // TODO: quoting if " or \n in string - f << "\"" << value << "\""; + QString escaped = value; + escaped.replace('"', "\"\""); + f << "\"" << escaped << "\""; } static void writeSep(QTextStream &f) diff --git a/src/qt/forms/askpassphrasedialog.ui b/src/qt/forms/askpassphrasedialog.ui index 3f6b668e06..ff3a77165b 100644 --- a/src/qt/forms/askpassphrasedialog.ui +++ b/src/qt/forms/askpassphrasedialog.ui @@ -28,9 +28,6 @@ <layout class="QVBoxLayout" name="verticalLayout"> <item> <widget class="QLabel" name="warningLabel"> - <property name="text"> - <string>TextLabel</string> - </property> <property name="textFormat"> <enum>Qt::RichText</enum> </property> diff --git a/src/qt/forms/overviewpage.ui b/src/qt/forms/overviewpage.ui index cc67fae533..10e470e918 100644 --- a/src/qt/forms/overviewpage.ui +++ b/src/qt/forms/overviewpage.ui @@ -44,7 +44,7 @@ <item row="2" column="1"> <widget class="QLabel" name="labelBalance"> <property name="text"> - <string>123.456 BTC</string> + <string notr="true">0 BTC</string> </property> </widget> </item> @@ -72,18 +72,20 @@ <item row="3" column="1"> <widget class="QLabel" name="labelUnconfirmed"> <property name="text"> - <string>0 BTC</string> + <string notr="true">0 BTC</string> </property> </widget> </item> <item row="1" column="0"> <widget class="QLabel" name="label_5"> + <property name="font"> + <font> + <pointsize>11</pointsize> + <bold>true</bold> + </font> + </property> <property name="text"> - <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Wallet</span></p></body></html></string> + <string>Wallet</string> </property> </widget> </item> diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 59c44ac5f9..0c43647b10 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -213,7 +213,7 @@ MainOptionsPage::MainOptionsPage(QWidget *parent): proxy_hbox->addStretch(1); layout->addLayout(proxy_hbox); - QLabel *fee_help = new QLabel(tr("Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.")); + QLabel *fee_help = new QLabel(tr("Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.")); fee_help->setWordWrap(true); layout->addWidget(fee_help); @@ -222,7 +222,6 @@ MainOptionsPage::MainOptionsPage(QWidget *parent): QLabel *fee_label = new QLabel(tr("Pay transaction &fee")); fee_hbox->addWidget(fee_label); fee_edit = new BitcoinAmountField(); - fee_edit->setToolTip(tr("Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.")); fee_label->setBuddy(fee_edit); fee_hbox->addWidget(fee_edit); diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index a915274da3..b9ccb06c09 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -150,14 +150,21 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(const QList<SendCoinsRecipie hex = QString::fromStdString(wtx.GetHash().GetHex()); } - // Add addresses that we've sent to to the address book + // Add addresses / update labels that we've sent to to the address book foreach(const SendCoinsRecipient &rcp, recipients) { std::string strAddress = rcp.address.toStdString(); + std::string strLabel = rcp.label.toStdString(); { LOCK(wallet->cs_wallet); - if (!wallet->mapAddressBook.count(strAddress)) - wallet->SetAddressBookName(strAddress, rcp.label.toStdString()); + + std::map<CBitcoinAddress, std::string>::iterator mi = wallet->mapAddressBook.find(strAddress); + + // Check if we have a new address or an updated label + if (mi == wallet->mapAddressBook.end() || mi->second != strLabel) + { + wallet->SetAddressBookName(strAddress, strLabel); + } } } diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp index 1bc87e9217..2db4882068 100644 --- a/src/rpcdump.cpp +++ b/src/rpcdump.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2012 Bitcoin Developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "init.h" // for pwalletMain #include "bitcoinrpc.h" diff --git a/src/script.cpp b/src/script.cpp index 56c2e500d0..ccb19c388e 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <boost/foreach.hpp> #include <boost/tuple/tuple.hpp> diff --git a/src/script.h b/src/script.h index e41e09b6b3..5397a1972f 100644 --- a/src/script.h +++ b/src/script.h @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef H_BITCOIN_SCRIPT #define H_BITCOIN_SCRIPT diff --git a/src/serialize.h b/src/serialize.h index fe2aebe7f5..349a40bfe8 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_SERIALIZE_H #define BITCOIN_SERIALIZE_H diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index 7ff7545ab4..c7e4bdd556 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -26,3 +26,9 @@ void Shutdown(void* parg) { exit(0); } + +void StartShutdown() +{ + exit(0); +} + diff --git a/src/ui_interface.h b/src/ui_interface.h index 514768086d..63d2e5c1d0 100644 --- a/src/ui_interface.h +++ b/src/ui_interface.h @@ -1,6 +1,6 @@ // Copyright (c) 2010 Satoshi Nakamoto // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_UI_INTERFACE_H #define BITCOIN_UI_INTERFACE_H diff --git a/src/uint256.h b/src/uint256.h index 9966a14ed7..fc5ed26592 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_UINT256_H #define BITCOIN_UINT256_H diff --git a/src/util.cpp b/src/util.cpp index d8804c7291..a40771417b 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "util.h" #include "strlcpy.h" @@ -26,6 +26,7 @@ namespace boost { #include <boost/interprocess/sync/interprocess_mutex.hpp> #include <boost/interprocess/sync/interprocess_recursive_mutex.hpp> #include <boost/foreach.hpp> +#include <boost/thread.hpp> #include <openssl/crypto.h> #include <openssl/rand.h> @@ -215,6 +216,8 @@ inline int OutputDebugStringF(const char* pszFormat, ...) if (fileout) { static bool fStartedNewLine = true; + static boost::mutex mutexDebugLog; + boost::mutex::scoped_lock scoped_lock(mutexDebugLog); // Debug print useful for profiling if (fLogTimestamps && fStartedNewLine) @@ -849,7 +852,7 @@ boost::filesystem::path GetDefaultDataDir() #ifdef MAC_OSX // Mac pathRet /= "Library/Application Support"; - filesystem::create_directory(pathRet); + fs::create_directory(pathRet); return pathRet / "Bitcoin"; #else // Unix diff --git a/src/util.h b/src/util.h index 714084e410..ef15260773 100644 --- a/src/util.h +++ b/src/util.h @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_UTIL_H #define BITCOIN_UTIL_H @@ -218,9 +218,11 @@ public: { printf("LOCKCONTENTION: %s\n", pszName); printf("Locker: %s:%d\n", pszFile, nLine); - } #endif lock.lock(); +#ifdef DEBUG_LOCKCONTENTION + } +#endif } } diff --git a/src/version.cpp b/src/version.cpp index 0c1e8bfa80..60b7aae2e5 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <string> #include "version.h" diff --git a/src/version.h b/src/version.h index c0ec97ddf2..9718e75afb 100644 --- a/src/version.h +++ b/src/version.h @@ -1,6 +1,6 @@ // Copyright (c) 2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_VERSION_H #define BITCOIN_VERSION_H @@ -10,10 +10,11 @@ // client versioning // -static const int CLIENT_VERSION_MAJOR = 0; -static const int CLIENT_VERSION_MINOR = 6; -static const int CLIENT_VERSION_REVISION = 3; -static const int CLIENT_VERSION_BUILD = 0; +// These need to be macro's, as version.cpp's voodoo requires it +#define CLIENT_VERSION_MAJOR 0 +#define CLIENT_VERSION_MINOR 6 +#define CLIENT_VERSION_REVISION 3 +#define CLIENT_VERSION_BUILD 0 static const int CLIENT_VERSION = 1000000 * CLIENT_VERSION_MAJOR diff --git a/src/wallet.cpp b/src/wallet.cpp index 998909897f..d7a70fe563 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "wallet.h" #include "walletdb.h" @@ -242,7 +242,8 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase) if (fFileBacked) { pwalletdbEncryption = new CWalletDB(strWalletFile); - pwalletdbEncryption->TxnBegin(); + if (!pwalletdbEncryption->TxnBegin()) + return false; pwalletdbEncryption->WriteMasterKey(nMasterKeyMaxID, kMasterKey); } diff --git a/src/wallet.h b/src/wallet.h index 44c11e2ec4..9e451f89d6 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_WALLET_H #define BITCOIN_WALLET_H diff --git a/src/walletdb.cpp b/src/walletdb.cpp index 709ecac184..865911c434 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "walletdb.h" #include "wallet.h" @@ -189,7 +189,7 @@ int CWalletDB::LoadWallet(CWallet* pwallet) //// debug print //printf("LoadWallet %s\n", wtx.GetHash().ToString().c_str()); - //printf(" %12I64d %s %s %s\n", + //printf(" %12"PRI64d" %s %s %s\n", // wtx.vout[0].nValue, // DateTimeStrFormat("%x %H:%M:%S", wtx.GetBlockTime()).c_str(), // wtx.hashBlock.ToString().substr(0,20).c_str(), diff --git a/src/walletdb.h b/src/walletdb.h index 46ba7967ca..dee1750262 100644 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -1,7 +1,7 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying -// file license.txt or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_WALLETDB_H #define BITCOIN_WALLETDB_H |