From fcc547346a9c9f66855b9c8584e405291c864287 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Sat, 17 Mar 2012 19:54:22 -0400 Subject: [PATCH 1/9] Move QMAKE_LIBS_QT_ENTRY adjustment to bitcoin side of build It could just as well be on either part of the gitian build, but to safely put it on the Qt side would require bumping the filename, and every gitian user rebuilding it. v0.5.3.1 put it on the Bitcoin side, and this is easier to work with and keep safe, so I'm moving it. Use `qmake MINGW_THREAD_BUGFIX=0` to disable --- bitcoin-qt.pro | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro index ff5df982..ad6fb001 100644 --- a/bitcoin-qt.pro +++ b/bitcoin-qt.pro @@ -251,10 +251,20 @@ isEmpty(BOOST_INCLUDE_PATH) { macx:BOOST_INCLUDE_PATH = /opt/local/include } -windows:LIBS += -lmingwthrd -lws2_32 -windows:DEFINES += _MT WIN32 +windows:LIBS += -lws2_32 +windows:DEFINES += WIN32 windows:RC_FILE = src/qt/res/bitcoin-qt.rc -windows:QMAKE_LIBS_QT_ENTRY -= -lmingw32 + +windows:!contains(MINGW_THREAD_BUGFIX, 0) { + # At least qmake's win32-g++-cross profile is missing the -lmingwthrd + # thread-safety flag. GCC has -mthreads to enable this, but it doesn't + # work with static linking. -lmingwthrd must come BEFORE -lmingw, so + # it is prepended to QMAKE_LIBS_QT_ENTRY. + # It can be turned off with MINGW_THREAD_BUGFIX=0, just in case it causes + # any problems on some untested qmake profile now or in the future. + DEFINES += _MT + QMAKE_LIBS_QT_ENTRY = -lmingwthrd $$QMAKE_LIBS_QT_ENTRY +} macx:HEADERS += src/qt/macdockiconhandler.h macx:OBJECTIVE_SOURCES += src/qt/macdockiconhandler.mm From e364ad962f40afb091db5f03a0c48342063672a0 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Tue, 20 Mar 2012 13:45:45 -0400 Subject: [PATCH 2/9] Use last checkpoint instead of hard-coded 140,700. Fixes #913. --- src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 759e514c..c2decc33 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1508,10 +1508,11 @@ bool CBlock::AcceptBlock() return error("AcceptBlock() : AddToBlockIndex failed"); // Relay inventory, but don't relay old inventory during initial block download + int nBlockEstimate = Checkpoints::GetTotalBlocksEstimate(); if (hashBestChain == hash) CRITICAL_BLOCK(cs_vNodes) BOOST_FOREACH(CNode* pnode, vNodes) - if (nBestHeight > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : 140700)) + if (nBestHeight > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : nBlockEstimate)) pnode->PushInventory(CInv(MSG_BLOCK, hash)); return true; From 68d889db3458366a161b847f38346da0a650c1ed Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 22 Mar 2012 16:15:30 -0400 Subject: [PATCH 3/9] Fix grammatical errors in translation process documentation (partial of 2fac102) --- doc/translation_process.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/translation_process.md b/doc/translation_process.md index cf100057..603d557c 100644 --- a/doc/translation_process.md +++ b/doc/translation_process.md @@ -1,7 +1,7 @@ Translations ============ -The QT GUI can be easily be translated into other languages. Here's how we +The Qt GUI can be easily translated into other languages. Here's how we handle those translations. Files and Folders @@ -30,10 +30,10 @@ This directory contains all translations. Filenames must adhere to this format: #### Source file -`src/qt/locale/bitcoin_en.ts` is a treated in a special way. It is used as the -source for all other translations. Whenever a string in the code is change +`src/qt/locale/bitcoin_en.ts` is treated in a special way. It is used as the +source for all other translations. Whenever a string in the code is changed this file must be updated to reflect those changes. Usually, this can be -accomplished by running `lupdate` +accomplished by running `lupdate`. Syncing with transifex ---------------------- @@ -42,9 +42,9 @@ We are using http://transifex.net as a frontend for translating the client. https://www.transifex.net/projects/p/bitcoin/resource/tx/ -The "transifex client":http://help.transifex.net/features/client/index.html -will help with fetching new translations from transifex. - +The "transifex client" (see: http://help.transifex.net/features/client/) +will help with fetching new translations from transifex. Use the following +config to be able to connect with the client. ### .tx/config From 8ed1f7c1532fe3e67ca5f7fc7c1c920bbf297203 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sun, 19 Feb 2012 19:42:15 +0100 Subject: [PATCH 4/9] Report number of (dis)connected blocks in reorganization Also report old and new best, and fork point. --- src/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index c2decc33..12703621 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1311,6 +1311,9 @@ bool static Reorganize(CTxDB& txdb, CBlockIndex* pindexNew) BOOST_FOREACH(CTransaction& tx, vDelete) tx.RemoveFromMemoryPool(); + printf("REORGANIZE: Disconnected %i blocks; %s..%s\n", vDisconnect.size(), pfork->GetBlockHash().ToString().substr(0,20).c_str(), pindexBest->GetBlockHash().ToString().substr(0,20).c_str()); + printf("REORGANIZE: Connected %i blocks; %s..%s\n", vConnect.size(), pfork->GetBlockHash().ToString().substr(0,20).c_str(), pindexNew->GetBlockHash().ToString().substr(0,20).c_str()); + return true; } From b6751ed1b2a71e07cd3a8af4f02ce64fec39fe88 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 21 Mar 2012 13:15:27 +0100 Subject: [PATCH 5/9] More debug output for failed reorganizations --- src/main.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 12703621..5c1b138d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1251,6 +1251,9 @@ bool static Reorganize(CTxDB& txdb, CBlockIndex* pindexNew) vConnect.push_back(pindex); reverse(vConnect.begin(), vConnect.end()); + printf("REORGANIZE: Disconnect %i blocks; %s..%s\n", vDisconnect.size(), pfork->GetBlockHash().ToString().substr(0,20).c_str(), pindexBest->GetBlockHash().ToString().substr(0,20).c_str()); + printf("REORGANIZE: Connect %i blocks; %s..%s\n", vConnect.size(), pfork->GetBlockHash().ToString().substr(0,20).c_str(), pindexNew->GetBlockHash().ToString().substr(0,20).c_str()); + // Disconnect shorter branch vector vResurrect; BOOST_FOREACH(CBlockIndex* pindex, vDisconnect) @@ -1259,7 +1262,7 @@ bool static Reorganize(CTxDB& txdb, CBlockIndex* pindexNew) if (!block.ReadFromDisk(pindex)) return error("Reorganize() : ReadFromDisk for disconnect failed"); if (!block.DisconnectBlock(txdb, pindex)) - return error("Reorganize() : DisconnectBlock failed"); + return error("Reorganize() : DisconnectBlock %s failed", pindex->GetBlockHash().ToString().substr(0,20).c_str()); // Queue memory transactions to resurrect BOOST_FOREACH(const CTransaction& tx, block.vtx) @@ -1279,7 +1282,7 @@ bool static Reorganize(CTxDB& txdb, CBlockIndex* pindexNew) { // Invalid block txdb.TxnAbort(); - return error("Reorganize() : ConnectBlock failed"); + return error("Reorganize() : ConnectBlock %s failed", pindex->GetBlockHash().ToString().substr(0,20).c_str()); } // Queue memory transactions to delete @@ -1311,8 +1314,7 @@ bool static Reorganize(CTxDB& txdb, CBlockIndex* pindexNew) BOOST_FOREACH(CTransaction& tx, vDelete) tx.RemoveFromMemoryPool(); - printf("REORGANIZE: Disconnected %i blocks; %s..%s\n", vDisconnect.size(), pfork->GetBlockHash().ToString().substr(0,20).c_str(), pindexBest->GetBlockHash().ToString().substr(0,20).c_str()); - printf("REORGANIZE: Connected %i blocks; %s..%s\n", vConnect.size(), pfork->GetBlockHash().ToString().substr(0,20).c_str(), pindexNew->GetBlockHash().ToString().substr(0,20).c_str()); + printf("REORGANIZE: done\n"); return true; } From 04dc79f1cc19b48531cc9a16ca502eac34d7e95b Mon Sep 17 00:00:00 2001 From: Alistair Buxton Date: Sun, 18 Mar 2012 03:03:24 +0000 Subject: [PATCH 6/9] When disconnecting a node, clear the received buffer so that we do not process any already received messages. The primary reason to do this is if a node spams hundreds of messages and we ban them, we don't want to continue processing the rest of it. --- src/net.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/net.cpp b/src/net.cpp index a8d3d0b1..763e160e 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -716,6 +716,7 @@ void CNode::CloseSocketDisconnect() printf("disconnecting node %s\n", addr.ToString().c_str()); closesocket(hSocket); hSocket = INVALID_SOCKET; + vRecv.clear(); } } From 1941765ae25d7223cdd4c44deb7474ae75dc48dc Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 21 Mar 2012 22:29:33 +0100 Subject: [PATCH 7/9] Fix warning about deprecated unescaped backslash --- bitcoin-qt.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitcoin-qt.pro b/bitcoin-qt.pro index ad6fb001..2b6fc571 100644 --- a/bitcoin-qt.pro +++ b/bitcoin-qt.pro @@ -204,7 +204,7 @@ CODECFORTR = UTF-8 TRANSLATIONS = $$files(src/qt/locale/bitcoin_*.ts) isEmpty(QMAKE_LRELEASE) { - win32:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\lrelease.exe + win32:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\\lrelease.exe else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease } isEmpty(TS_DIR):TS_DIR = src/qt/locale From fea0a27ddc30f2d51c386d268499d6c50363c202 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Thu, 22 Mar 2012 04:59:59 +0100 Subject: [PATCH 8/9] Check minversion before loading the rest of the wallet When a 0.6 wallet with compressed pubkeys is created, it writes a minversion record to prevent older clients from reading it. If the 0.5 loading it sees a key record before seeing the minversion record however, it will fail with DB_CORRUPT instead of DB_TOO_NEW. --- src/db.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/db.cpp b/src/db.cpp index 7f9439bf..bf335e7e 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -795,6 +795,13 @@ int CWalletDB::LoadWallet(CWallet* pwallet) //// todo: shouldn't we catch exceptions and try to recover and continue? CRITICAL_BLOCK(pwallet->cs_wallet) { + int nMinVersion = 0; + if (Read((string)"minversion", nMinVersion)) + { + if (nMinVersion > VERSION) + return DB_TOO_NEW; + } + // Get cursor Dbc* pcursor = GetCursor(); if (!pcursor) @@ -980,13 +987,6 @@ int CWalletDB::LoadWallet(CWallet* pwallet) if (strKey == "addrProxy") ssValue >> addrProxy; if (fHaveUPnP && strKey == "fUseUPnP") ssValue >> fUseUPnP; } - else if (strType == "minversion") - { - int nMinVersion = 0; - ssValue >> nMinVersion; - if (nMinVersion > VERSION) - return DB_TOO_NEW; - } } pcursor->close(); } From 9504e415cbeb128331fa4715bcccfaad6a443731 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Mon, 26 Mar 2012 12:33:35 -0400 Subject: [PATCH 9/9] Remove wxWidgets .exe and locales during setup --- share/setup.nsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/share/setup.nsi b/share/setup.nsi index c574269b..55390f35 100644 --- a/share/setup.nsi +++ b/share/setup.nsi @@ -75,6 +75,10 @@ Section -Main SEC0000 File /r /x *.exe /x *.o ../src\*.* SetOutPath $INSTDIR WriteRegStr HKCU "${REGKEY}\Components" Main 1 + + # Remove old wxwidgets-based-bitcoin executable and locales: + Delete /REBOOTOK $INSTDIR\bitcoin.exe + RMDir /r /REBOOTOK $INSTDIR\locale SectionEnd Section -post SEC0001