From b354251f1aa2e98585de0942d1fb4f1ec599a39b Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Wed, 9 May 2012 17:02:07 +0000 Subject: [PATCH 01/10] Bugfix: getwork: NULL pindexPrev across CreateNewBlock, in case it fails --- rpc.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/rpc.cpp b/rpc.cpp index 113de85a9db..a579a5d905a 100644 --- a/rpc.cpp +++ b/rpc.cpp @@ -967,8 +967,13 @@ Value getwork(const Array& params, bool fHelp) delete pblock; vNewBlock.clear(); } + + // Clear pindexPrev so future getworks make a new block, despite any failures from here on + pindexPrev = NULL; + + // Store the pindexBest used before CreateNewBlock, to avoid races nTransactionsUpdatedLast = nTransactionsUpdated; - pindexPrev = pindexBest; + CBlockIndex* pindexPrevNew = pindexBest; nStart = GetTime(); // Create new block @@ -976,6 +981,9 @@ Value getwork(const Array& params, bool fHelp) if (!pblock) throw JSONRPCError(-7, "Out of memory"); vNewBlock.push_back(pblock); + + // Need to update only after we know CreateNewBlock succeeded + pindexPrev = pindexPrevNew; } // Update nTime From 5d53f48acbbba0ac80e8a26545a3ecaf8d139356 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Wed, 9 May 2012 17:08:39 +0000 Subject: [PATCH 02/10] Bugfix: getmemorypool: NULL pindexPrev across CreateNewBlock, in case it fails --- src/bitcoinrpc.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 05913cd0ffb..d8d65e7f426 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -1760,16 +1760,26 @@ Value getmemorypool(const Array& params, bool fHelp) if (pindexPrev != pindexBest || (nTransactionsUpdated != nTransactionsUpdatedLast && GetTime() - nStart > 5)) { + // Clear pindexPrev so future calls make a new block, despite any failures from here on + pindexPrev = NULL; + + // Store the pindexBest used before CreateNewBlock, to avoid races nTransactionsUpdatedLast = nTransactionsUpdated; - pindexPrev = pindexBest; + CBlockIndex* pindexPrevNew = pindexBest; nStart = GetTime(); // Create new block if(pblock) + { delete pblock; + pblock = NULL; + } pblock = CreateNewBlock(reservekey); if (!pblock) throw JSONRPCError(-7, "Out of memory"); + + // Need to update only after we know CreateNewBlock succeeded + pindexPrev = pindexPrevNew; } // Update nTime From fb4dbbd188b68c4374c48dba5e481a35e920a6bf Mon Sep 17 00:00:00 2001 From: fanquake Date: Wed, 18 Jul 2012 22:11:56 +0800 Subject: [PATCH 03/10] Docs Tidy up (PARTIAL cherry pick) --- doc/README | 2 +- doc/build-osx.txt | 2 +- doc/build-unix.txt | 2 +- doc/unit-tests.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/README b/doc/README index 664a1747366..00e24e78195 100644 --- a/doc/README +++ b/doc/README @@ -2,7 +2,7 @@ Bitcoin 0.4.7 BETA 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. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/). This product includes cryptographic software written by Eric Young (eay@cryptsoft.com). diff --git a/doc/build-osx.txt b/doc/build-osx.txt index 52d876d82b3..c02c92e06bc 100644 --- a/doc/build-osx.txt +++ b/doc/build-osx.txt @@ -1,7 +1,7 @@ Copyright (c) 2010 Laszlo Hanyecz Portions Copyright (c) 2011 Douglas Huff Distributed under the MIT/X11 software license, see the accompanying file -license.txt or http://www.opensource.org/licenses/mit-license.php. This +COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/). This product includes cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by diff --git a/doc/build-unix.txt b/doc/build-unix.txt index e608c25f066..66f548fc464 100644 --- a/doc/build-unix.txt +++ b/doc/build-unix.txt @@ -1,6 +1,6 @@ Copyright (c) 2009-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. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/). This product includes cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP diff --git a/doc/unit-tests.txt b/doc/unit-tests.txt index 1168de7b70a..671ec3e7198 100644 --- a/doc/unit-tests.txt +++ b/doc/unit-tests.txt @@ -1,4 +1,4 @@ -Compiling/runing bitcoind unit tests +Compiling/running bitcoind unit tests ------------------------------------ bitcoind unit tests are in the src/test/ directory; they From b8dcb38b4ec674282a730c0eef214794502d9f4e Mon Sep 17 00:00:00 2001 From: fanquake Date: Mon, 23 Jul 2012 11:59:02 +0800 Subject: [PATCH 04/10] Fix Typo --- src/qt/bitcoin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 6986d39cbf2..6debec703ad 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -130,7 +130,7 @@ std::string _(const char* psz) static void handleRunawayException(std::exception *e) { PrintExceptionContinue(e, "Runaway exception"); - QMessageBox::critical(0, "Runaway exception", BitcoinGUI::tr("A fatal error occured. Bitcoin can no longer continue safely and will quit.") + QString("\n\n") + QString::fromStdString(strMiscWarning)); + QMessageBox::critical(0, "Runaway exception", BitcoinGUI::tr("A fatal error occurred. Bitcoin can no longer continue safely and will quit.") + QString("\n\n") + QString::fromStdString(strMiscWarning)); exit(1); } From 895191b9a8b2e80e2462b98329652f0e97c40322 Mon Sep 17 00:00:00 2001 From: fanquake Date: Mon, 23 Jul 2012 12:03:48 +0800 Subject: [PATCH 05/10] Typo --- src/qt/guiutil.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index 7e2b006d929..ef57e017b43 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -28,7 +28,7 @@ public: static void setupAddressWidget(QLineEdit *widget, QWidget *parent); static void setupAmountWidget(QLineEdit *widget, QWidget *parent); - // Parse "bitcoin:" URI into recipient object, return true on succesful parsing + // Parse "bitcoin:" URI into recipient object, return true on successful parsing // See Bitcoin URI definition discussion here: https://bitcointalk.org/index.php?topic=33490.0 static bool parseBitcoinURI(const QUrl *, SendCoinsRecipient *out); static bool parseBitcoinURI(QString uri, SendCoinsRecipient *out); From 0a9972bf1bb7878268fc84ea3794dfddf5b170cb Mon Sep 17 00:00:00 2001 From: Stephane Glondu Date: Tue, 24 Jul 2012 10:20:25 +0200 Subject: [PATCH 06/10] Fix spelling of successfully --- src/qt/askpassphrasedialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/askpassphrasedialog.cpp b/src/qt/askpassphrasedialog.cpp index 31e4040d1d2..e96f41941cf 100644 --- a/src/qt/askpassphrasedialog.cpp +++ b/src/qt/askpassphrasedialog.cpp @@ -158,7 +158,7 @@ void AskPassphraseDialog::accept() if(model->changePassphrase(oldpass, newpass1)) { QMessageBox::information(this, tr("Wallet encrypted"), - tr("Wallet passphrase was succesfully changed.")); + tr("Wallet passphrase was successfully changed.")); QDialog::accept(); // Success } else From 7543a5611ba78220f17f02306e5d274cb3cf00d3 Mon Sep 17 00:00:00 2001 From: Michael Ford Date: Thu, 26 Jul 2012 10:07:43 +0800 Subject: [PATCH 07/10] Typo --- src/qt/sendcoinsdialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index ef2f1c31869..b27efc24b7b 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -115,7 +115,7 @@ void SendCoinsDialog::on_sendButton_clicked() { case WalletModel::InvalidAddress: QMessageBox::warning(this, tr("Send Coins"), - tr("The recepient address is not valid, please recheck."), + tr("The recipient address is not valid, please recheck."), QMessageBox::Ok, QMessageBox::Ok); break; case WalletModel::InvalidAmount: From 9e98fe6f584d8bdd0ffe4d5dc5c0b908beb456db Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 26 Jul 2012 00:48:39 +0000 Subject: [PATCH 08/10] Bugfix: Fix a variety of misspellings (PARTIAL: Left out anything changing debug.log) --- doc/coding.txt | 4 ++-- src/base58.h | 2 +- src/crypter.cpp | 4 ++-- src/init.cpp | 4 ++-- src/irc.cpp | 2 +- src/main.cpp | 26 +++++++++++++------------- src/net.cpp | 10 +++++----- src/protocol.cpp | 2 +- src/rpc.cpp | 6 +++--- src/script.cpp | 2 +- src/wallet.cpp | 4 ++-- 11 files changed, 33 insertions(+), 33 deletions(-) diff --git a/doc/coding.txt b/doc/coding.txt index b3c812a4865..cc41850a5c7 100644 --- a/doc/coding.txt +++ b/doc/coding.txt @@ -22,8 +22,8 @@ bool Function(char* psz, int n) - No extra spaces inside parenthesis; please don't do ( this ) - No space after function names, one space after if, for and while -Variable names begin with the type in lowercase, like nSomeVariable. -Please don't put the first word of the variable name in lowercase like +Variable names begin with the type in lower-case, like nSomeVariable. +Please don't put the first word of the variable name in lower-case like someVariable. Common types: diff --git a/src/base58.h b/src/base58.h index 43f3ac2881e..af1022dfc07 100644 --- a/src/base58.h +++ b/src/base58.h @@ -10,7 +10,7 @@ // could be used to create visually identical looking account numbers. // - A string with non-alphanumeric characters is not as easily accepted as an account number. // - E-mail usually won't line-break if there's no punctuation to break at. -// - Doubleclicking selects the whole number as one word if it's all alphanumeric. +// - Double-clicking selects the whole number as one word if it's all alphanumeric. // #ifndef BITCOIN_BASE58_H #define BITCOIN_BASE58_H diff --git a/src/crypter.cpp b/src/crypter.cpp index e821b089bab..8b0f8eb3370 100644 --- a/src/crypter.cpp +++ b/src/crypter.cpp @@ -20,7 +20,7 @@ bool CCrypter::SetKeyFromPassphrase(const std::string& strKeyData, const std::ve if (nRounds < 1 || chSalt.size() != WALLET_CRYPTO_SALT_SIZE) return false; - // Try to keep the keydata out of swap (and be a bit over-careful to keep the IV that we don't even use out of swap) + // Try to keep the key data out of swap (and be a bit over-careful to keep the IV that we don't even use out of swap) // Note that this does nothing about suspend-to-disk (which will put all our key data on disk) // Note as well that at no point in this program is any attempt made to prevent stealing of keys by reading the memory of the running process. mlock(&chKey[0], sizeof chKey); @@ -47,7 +47,7 @@ bool CCrypter::SetKey(const CKeyingMaterial& chNewKey, const std::vector= 1400 - // Disable confusing "helpful" text message on abort, ctrl-c + // Disable confusing "helpful" text message on abort, Ctrl-C _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT); #endif #ifndef __WXMSW__ diff --git a/src/irc.cpp b/src/irc.cpp index 76157bd034a..cb9c0b7ab83 100644 --- a/src/irc.cpp +++ b/src/irc.cpp @@ -254,7 +254,7 @@ void ThreadIRCSeed(void* parg) void ThreadIRCSeed2(void* parg) { - /* Dont advertise on IRC if we don't allow incoming connections */ + /* Don't advertise on IRC if we don't allow incoming connections */ if (mapArgs.count("-connect") || fNoListen) return; diff --git a/src/main.cpp b/src/main.cpp index 453b0f82579..d5d4605ea17 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -881,7 +881,7 @@ bool CTransaction::DisconnectInputs(CTxDB& txdb) // Remove transaction from index // This can fail if a duplicate of this transaction was in a chain that got // reorganized away. This is only possible if this transaction was completely - // spent, so erasing it would be a no-op anway. + // spent, so erasing it would be a no-op anyway. txdb.EraseTxIndex(*this); return true; @@ -1516,7 +1516,7 @@ bool CBlock::CheckBlock() const if (GetSigOpCount() > MAX_BLOCK_SIGOPS) return error("CheckBlock() : out-of-bounds SigOpCount"); - // Check merkleroot + // Check merkle root if (hashMerkleRoot != BuildMerkleTree()) return error("CheckBlock() : hashMerkleRoot mismatch"); @@ -1704,7 +1704,7 @@ FILE* AppendBlockFile(unsigned int& nFileRet) return NULL; if (fseek(file, 0, SEEK_END) != 0) return NULL; - // FAT32 filesize max 4GB, fseek and ftell max 2GB, so we must stay under 2GB + // FAT32 file size max 4GB, fseek and ftell max 2GB, so we must stay under 2GB if (ftell(file) < 0x7F000000 - MAX_SIZE) { nFileRet = nCurrentBlockFile; @@ -1798,7 +1798,7 @@ bool LoadBlockIndex(bool fAllowNew) void PrintBlockTree() { - // precompute tree structure + // pre-compute tree structure map > mapNext; for (map::iterator mi = mapBlockIndex.begin(); mi != mapBlockIndex.end(); ++mi) { @@ -1851,7 +1851,7 @@ void PrintBlockTree() PrintWallets(block); - // put the main timechain first + // put the main time-chain first vector& vNext = mapNext[pindex]; for (unsigned int i = 0; i < vNext.size(); i++) { @@ -2015,7 +2015,7 @@ bool static AlreadyHave(CTxDB& txdb, const CInv& inv) // The message start string is designed to be unlikely to occur in normal data. -// The characters are rarely used upper ascii, not valid as UTF-8, and produce +// The characters are rarely used upper ASCII, not valid as UTF-8, and produce // a large 4-byte int at any alignment. unsigned char pchMessageStart[4] = { 0xf9, 0xbe, 0xb4, 0xd9 }; @@ -2656,12 +2656,12 @@ bool ProcessMessages(CNode* pfrom) { if (strstr(e.what(), "end of data")) { - // Allow exceptions from underlength message on vRecv + // Allow exceptions from under-length message on vRecv 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 + // Allow exceptions from over-long size printf("ProcessMessages(%s, %u bytes) : Exception '%s' caught\n", strCommand.c_str(), nMessageSize, e.what()); } else @@ -2921,9 +2921,9 @@ unsigned int static ScanHash_CryptoPP(char* pmidstate, char* pdata, char* phash1 unsigned int& nNonce = *(unsigned int*)(pdata + 12); for (;;) { - // Crypto++ SHA-256 + // Crypto++ SHA256 // Hash pdata using pmidstate as the starting state into - // preformatted buffer phash1, then hash phash1 into phash + // pre-formatted buffer phash1, then hash phash1 into phash nNonce++; SHA256Transform(phash1, pdata, pmidstate); SHA256Transform(phash, phash1, pSHA256InitState); @@ -3148,7 +3148,7 @@ void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash1) { // - // Prebuild hash buffers + // Pre-build hash buffers // struct { @@ -3270,7 +3270,7 @@ void static BitcoinMiner(CWallet *pwallet) // - // Prebuild hash buffers + // Pre-build hash buffers // char pmidstatebuf[32+16]; char* pmidstate = alignup<16>(pmidstatebuf); char pdatabuf[128+16]; char* pdata = alignup<16>(pdatabuf); @@ -3295,7 +3295,7 @@ void static BitcoinMiner(CWallet *pwallet) unsigned int nHashesDone = 0; unsigned int nNonceFound; - // Crypto++ SHA-256 + // Crypto++ SHA256 nNonceFound = ScanHash_CryptoPP(pmidstate, pdata + 64, phash1, (char*)&hash, nHashesDone); diff --git a/src/net.cpp b/src/net.cpp index 7637f8854c3..d2fa111d233 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -357,7 +357,7 @@ bool GetMyExternalIP(unsigned int& ipRet) { // We should be phasing out our use of sites like these. If we need // replacements, we should ask for volunteers to put this simple - // php file on their webserver that prints the client IP: + // php file on their web server that prints the client IP: // if (nHost == 1) { @@ -680,7 +680,7 @@ CNode* ConnectNode(CAddress addrConnect, int64 nTimeout) /// debug print printf("connected %s\n", addrConnect.ToString().c_str()); - // Set to nonblocking + // Set to non-blocking #ifdef __WXMSW__ u_long nOne = 1; if (ioctlsocket(hSocket, FIONBIO, &nOne) == SOCKET_ERROR) @@ -1704,7 +1704,7 @@ bool BindListenPort(string& strError) #endif #ifdef __WXMSW__ - // Set to nonblocking, incoming connections will also inherit this + // Set to non-blocking, incoming connections will also inherit this if (ioctlsocket(hListenSocket, FIONBIO, (u_long*)&nOne) == SOCKET_ERROR) #else if (fcntl(hListenSocket, F_SETFL, O_NONBLOCK) == SOCKET_ERROR) @@ -1751,7 +1751,7 @@ void StartNode(void* parg) pnodeLocalHost = new CNode(INVALID_SOCKET, CAddress("127.0.0.1", 0, false, nLocalServices)); #ifdef __WXMSW__ - // Get local host ip + // Get local host IP char pszHostName[1000] = ""; if (gethostname(pszHostName, sizeof(pszHostName)) != SOCKET_ERROR) { @@ -1765,7 +1765,7 @@ void StartNode(void* parg) } } #else - // Get local host ip + // Get local host IP struct ifaddrs* myaddrs; if (getifaddrs(&myaddrs) == 0) { diff --git a/src/protocol.cpp b/src/protocol.cpp index 8314e2bb97f..15dd0de92f7 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -215,7 +215,7 @@ bool CAddress::IsRoutable() const bool CAddress::IsValid() const { - // Clean up 3-byte shifted addresses caused by garbage in size field + // Cleanup 3-byte shifted addresses caused by garbage in size field // of addr messages from versions before 0.2.9 checksum. // Two consecutive addr messages look like this: // header20 vectorlen3 addr26 addr26 addr26 header20 vectorlen3 addr26 addr26 addr26... diff --git a/src/rpc.cpp b/src/rpc.cpp index 7f905748749..c77c5055723 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -1580,7 +1580,7 @@ Value getwork(const Array& params, bool fHelp) // Save mapNewBlock[pblock->hashMerkleRoot] = make_pair(pblock, pblock->vtx[0].vin[0].scriptSig); - // Prebuild hash buffers + // Pre-build hash buffers char pmidstate[32]; char pdata[128]; char phash1[64]; @@ -1744,7 +1744,7 @@ string rfc1123Time() time(&now); struct tm* now_gmt = gmtime(&now); string locale(setlocale(LC_TIME, NULL)); - setlocale(LC_TIME, "C"); // we want posix (aka "C") weekday/month strings + setlocale(LC_TIME, "C"); // we want POSIX (aka "C") weekday/month strings strftime(buffer, sizeof(buffer), "%a, %d %b %Y %H:%M:%S +0000", now_gmt); setlocale(LC_TIME, locale.c_str()); return string(buffer); @@ -2421,7 +2421,7 @@ int CommandLineRPC(int argc, char *argv[]) int main(int argc, char *argv[]) { #ifdef _MSC_VER - // Turn off microsoft heap dump noise + // Turn off Microsoft heap dump noise _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); _CrtSetReportFile(_CRT_WARN, CreateFile("NUL", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0)); #endif diff --git a/src/script.cpp b/src/script.cpp index e7664d2cfcf..dd53f903dc6 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -904,7 +904,7 @@ uint256 SignatureHash(CScript scriptCode, const CTransaction& txTo, unsigned int } else if ((nHashType & 0x1f) == SIGHASH_SINGLE) { - // Only lockin the txout payee at same index as txin + // Only lock-in the txout payee at same index as txin unsigned int nOut = nIn; if (nOut >= txTmp.vout.size()) { diff --git a/src/wallet.cpp b/src/wallet.cpp index 8fe77119ee4..38d2b64a176 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -628,7 +628,7 @@ void CWallet::ReacceptWalletTransactions() } else { - // Reaccept any txes of ours that aren't already in a block + // Re-accept any txes of ours that aren't already in a block if (!wtx.IsCoinBase()) wtx.AcceptWalletTransaction(txdb, false); } @@ -637,7 +637,7 @@ void CWallet::ReacceptWalletTransactions() { // TODO: optimize this to scan just part of the block chain? if (ScanForWalletTransactions(pindexGenesisBlock)) - fRepeat = true; // Found missing transactions: re-do Reaccept. + fRepeat = true; // Found missing transactions: re-do re-accept. } } } From 982f4fd301435e56bb959267a8f69ff793b10e26 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 26 Jul 2012 00:48:39 +0000 Subject: [PATCH 09/10] Bugfix: Fix a variety of misspellings --- src/bitcoinrpc.cpp | 2 +- src/init.cpp | 2 +- src/key.h | 2 +- src/keystore.h | 2 +- src/net.h | 2 +- src/qt/askpassphrasedialog.cpp | 2 +- src/qt/bitcoinaddressvalidator.cpp | 4 ++-- src/qt/bitcoinamountfield.h | 2 +- src/qt/bitcoingui.cpp | 4 ++-- src/qt/bitcoingui.h | 4 ++-- src/qt/bitcoinunits.h | 6 +++--- src/qt/guiutil.cpp | 2 +- src/qt/guiutil.h | 2 +- src/qt/notificator.cpp | 4 ++-- src/qt/notificator.h | 2 +- src/qt/transactionfilterproxy.h | 2 +- src/qt/transactionview.cpp | 2 +- src/test/DoS_tests.cpp | 2 +- 18 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 4c0edb4e892..efc69a4e43e 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -2243,7 +2243,7 @@ void ThreadRPCServer2(void* parg) } catch(boost::system::system_error &e) { - ThreadSafeMessageBox(strprintf(_("An error occured while setting up the RPC port %i for listening: %s"), endpoint.port(), e.what()), + ThreadSafeMessageBox(strprintf(_("An error occurred while setting up the RPC port %i for listening: %s"), endpoint.port(), e.what()), _("Error"), wxOK | wxMODAL); StartShutdown(); return; diff --git a/src/init.cpp b/src/init.cpp index 31e2ce6bdec..172e66a27ad 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -78,7 +78,7 @@ void Shutdown(void* parg) 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 + // ensure non-UI client get's exited here, but let Bitcoin-Qt reach return 0; in bitcoin.cpp exit(0); #endif } diff --git a/src/key.h b/src/key.h index 4dc4914bdc1..eb54c3e98f5 100644 --- a/src/key.h +++ b/src/key.h @@ -78,7 +78,7 @@ err: // Perform ECDSA key recovery (see SEC1 4.1.6) for curves over (mod p)-fields // recid selects which key is recovered -// if check is nonzero, additional checks are performed +// if check is non-zero, additional checks are performed int static inline ECDSA_SIG_recover_key_GFp(EC_KEY *eckey, ECDSA_SIG *ecsig, const unsigned char *msg, int msglen, int recid, int check) { if (!eckey) return 0; diff --git a/src/keystore.h b/src/keystore.h index 87c84010d89..027c98a54d2 100644 --- a/src/keystore.h +++ b/src/keystore.h @@ -23,7 +23,7 @@ public: virtual bool HaveKey(const CBitcoinAddress &address) const =0; // Retrieve a key corresponding to a given address from the store. - // Return true if succesful. + // Return true if successful. virtual bool GetKey(const CBitcoinAddress &address, CKey& keyOut) const =0; // Retrieve only the public key corresponding to a given address. diff --git a/src/net.h b/src/net.h index 96e3680d380..622c02c3253 100644 --- a/src/net.h +++ b/src/net.h @@ -125,7 +125,7 @@ protected: int nRefCount; // Denial-of-service detection/prevention - // Key is ip address, value is banned-until-time + // Key is IP address, value is banned-until-time static std::map setBanned; static CCriticalSection cs_setBanned; int nMisbehavior; diff --git a/src/qt/askpassphrasedialog.cpp b/src/qt/askpassphrasedialog.cpp index e96f41941cf..2126edf0b22 100644 --- a/src/qt/askpassphrasedialog.cpp +++ b/src/qt/askpassphrasedialog.cpp @@ -178,7 +178,7 @@ void AskPassphraseDialog::accept() void AskPassphraseDialog::textChanged() { - // Validate input, set Ok button to enabled when accepable + // Validate input, set Ok button to enabled when acceptable bool acceptable = false; switch(mode) { diff --git a/src/qt/bitcoinaddressvalidator.cpp b/src/qt/bitcoinaddressvalidator.cpp index c804ad0d576..f1cc2aaa27b 100644 --- a/src/qt/bitcoinaddressvalidator.cpp +++ b/src/qt/bitcoinaddressvalidator.cpp @@ -5,8 +5,8 @@ This is: - All numbers except for '0' - - All uppercase letters except for 'I' and 'O' - - All lowercase letters except for 'l' + - All upper-case letters except for 'I' and 'O' + - All lower-case letters except for 'l' User friendly Base58 input can map - 'l' and 'I' to '1' diff --git a/src/qt/bitcoinamountfield.h b/src/qt/bitcoinamountfield.h index ead8bdb84ba..ca4a888e4ec 100644 --- a/src/qt/bitcoinamountfield.h +++ b/src/qt/bitcoinamountfield.h @@ -40,7 +40,7 @@ signals: void textChanged(); protected: - /** Intercept focus-in event and ',' keypresses */ + /** Intercept focus-in event and ',' key presses */ bool eventFilter(QObject *object, QEvent *event); private: diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index c36dd216d41..f8e75174315 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -150,7 +150,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent): // Clicking on a transaction on the overview page simply sends you to transaction history page connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage())); - // Doubleclicking on a transaction on the transaction history page shows details + // Double-clicking on a transaction on the transaction history page shows details connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails())); gotoOverviewPage(); @@ -335,7 +335,7 @@ void BitcoinGUI::setWalletModel(WalletModel *walletModel) setEncryptionStatus(walletModel->getEncryptionStatus()); connect(walletModel, SIGNAL(encryptionStatusChanged(int)), this, SLOT(setEncryptionStatus(int))); - // Balloon popup for new transaction + // Balloon pop-up for new transaction connect(walletModel->getTransactionTableModel(), SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(incomingTransaction(QModelIndex,int,int))); diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 0fcb72a3eec..313aa06c589 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -92,7 +92,7 @@ private: /** Create the main UI actions. */ void createActions(); - /** Create the menu bar and submenus. */ + /** Create the menu bar and sub-menus. */ void createMenuBar(); /** Create the toolbars */ void createToolBars(); @@ -153,7 +153,7 @@ private slots: void encryptWallet(bool status); /** Change encrypted wallet passphrase */ void changePassphrase(); - /** Ask for pass phrase to unlock wallet temporarily */ + /** Ask for passphrase to unlock wallet temporarily */ void unlockWallet(); }; diff --git a/src/qt/bitcoinunits.h b/src/qt/bitcoinunits.h index 18fa36a0b7b..9b7c9e160e9 100644 --- a/src/qt/bitcoinunits.h +++ b/src/qt/bitcoinunits.h @@ -5,7 +5,7 @@ #include /** Bitcoin unit definitions. Encapsulates parsing and formatting - and serves as list model for dropdown selection boxes. + and serves as list model for drop-down selection boxes. */ class BitcoinUnits: public QAbstractListModel { @@ -26,7 +26,7 @@ public: //! Unit conversion and formatting ///@{ - //! Get list of units, for dropdown box + //! Get list of units, for drop-down box static QList availableUnits(); //! Is unit ID valid? static bool valid(int unit); @@ -49,7 +49,7 @@ public: ///@} //! @name AbstractListModel implementation - //! List model for unit dropdown selection box. + //! List model for unit drop-down selection box. ///@{ enum RoleIndex { /** Unit identifier */ diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index f5e6e0a545f..eeba74b1752 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -80,7 +80,7 @@ bool GUIUtil::parseBitcoinURI(QString uri, SendCoinsRecipient *out) // Convert bitcoin:// to bitcoin: // // Cannot handle this later, because bitcoin:// will cause Qt to see the part after // as host, - // which will lowercase it (and thus invalidate the address). + // which will lower-case it (and thus invalidate the address). if(uri.startsWith("bitcoin://")) { uri.replace(0, 10, "bitcoin:"); diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index ef57e017b43..703156bc438 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -33,7 +33,7 @@ public: static bool parseBitcoinURI(const QUrl *, SendCoinsRecipient *out); static bool parseBitcoinURI(QString uri, SendCoinsRecipient *out); - /** Get save file name, mimics QFileDialog::getSaveFileName, except that it appends a default suffix + /** Get save filename, mimics QFileDialog::getSaveFileName, except that it appends a default suffix when no suffix is provided by the user. @param[in] parent Parent window (or 0) diff --git a/src/qt/notificator.cpp b/src/qt/notificator.cpp index e668079536e..c1c177dbfed 100644 --- a/src/qt/notificator.cpp +++ b/src/qt/notificator.cpp @@ -82,7 +82,7 @@ public: static int metaType(); - // Image to variant that can be marshaled over DBus + // Image to variant that can be marshalled over DBus static QVariant toVariant(const QImage &img); private: @@ -294,7 +294,7 @@ void Notificator::notify(Class cls, const QString &title, const QString &text, c default: if(cls == Critical) { - // Fall back to old fashioned popup dialog if critical and no other notification available + // Fall back to old fashioned pop-up dialog if critical and no other notification available QMessageBox::critical(parent, title, text, QMessageBox::Ok, QMessageBox::Ok); } break; diff --git a/src/qt/notificator.h b/src/qt/notificator.h index 0271c26f484..8abc0b2ec28 100644 --- a/src/qt/notificator.h +++ b/src/qt/notificator.h @@ -27,7 +27,7 @@ public: { Information, /**< Informational message */ Warning, /**< Notify user of potential problem */ - Critical /**< An error occured */ + Critical /**< An error occurred */ }; public slots: diff --git a/src/qt/transactionfilterproxy.h b/src/qt/transactionfilterproxy.h index 8d6829d6f09..30b98588f02 100644 --- a/src/qt/transactionfilterproxy.h +++ b/src/qt/transactionfilterproxy.h @@ -23,7 +23,7 @@ public: void setDateRange(const QDateTime &from, const QDateTime &to); void setAddressPrefix(const QString &addrPrefix); /** - @note Type filter takes a bitfield created with TYPE() or ALL_TYPES + @note Type filter takes a bit field created with TYPE() or ALL_TYPES */ void setTypeFilter(quint32 modes); void setMinAmount(qint64 minimum); diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index b5b3792f8e3..5f53241662d 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -205,7 +205,7 @@ void TransactionView::chooseDate(int idx) TransactionFilterProxy::MAX_DATE); break; case ThisWeek: { - // Find last monday + // Find last Monday QDate startOfWeek = current.addDays(-(current.dayOfWeek()-1)); transactionProxyModel->setDateRange( QDateTime(startOfWeek), diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp index 01e6691254a..b395326711d 100644 --- a/src/test/DoS_tests.cpp +++ b/src/test/DoS_tests.cpp @@ -20,7 +20,7 @@ BOOST_AUTO_TEST_CASE(DoS_banning) CNode dummyNode1(INVALID_SOCKET, addr1, true); dummyNode1.Misbehaving(100); // Should get banned BOOST_CHECK(CNode::IsBanned(addr1.ip)); - BOOST_CHECK(!CNode::IsBanned(addr1.ip|0x0000ff00)); // Different ip, not banned + BOOST_CHECK(!CNode::IsBanned(addr1.ip|0x0000ff00)); // Different IP, not banned CAddress addr2(0xa0b0c002); CNode dummyNode2(INVALID_SOCKET, addr2, true); From 3171daef6c106023a5fcbc80e66c0e0a9552c4d8 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 26 Jul 2012 00:48:39 +0000 Subject: [PATCH 10/10] Bugfix: Fix a variety of misspellings --- src/addrman.h | 2 +- src/main.cpp | 2 +- src/netbase.cpp | 2 +- src/netbase.h | 4 ++-- src/qt/bitcoin.cpp | 2 +- src/script.cpp | 4 ++-- src/test/script_P2SH_tests.cpp | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/addrman.h b/src/addrman.h index e89fbba9f1b..1ccde823615 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -116,7 +116,7 @@ public: // * Bucket selection is based on cryptographic hashing, using a randomly-generated 256-bit key, which should not // be observable by adversaries. // * Several indexes are kept for high performance. Defining DEBUG_ADDRMAN will introduce frequent (and expensive) -// consistency checks for the entire datastructure. +// consistency checks for the entire data structure. // total number of buckets for tried addresses #define ADDRMAN_TRIED_BUCKET_COUNT 64 diff --git a/src/main.cpp b/src/main.cpp index 4bd63bb26b4..ac26fd7ff62 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1565,7 +1565,7 @@ bool CBlock::SetBestChain(CTxDB& txdb, CBlockIndex* pindexNew) return error("SetBestChain() : Reorganize failed"); } - // Connect futher blocks + // Connect further blocks BOOST_REVERSE_FOREACH(CBlockIndex *pindex, vpindexSecondary) { CBlock block; diff --git a/src/netbase.cpp b/src/netbase.cpp index 2f2457ade62..84038ffb45d 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -549,7 +549,7 @@ std::vector CNetAddr::GetGroup() const nClass = 1; nStartByte = 2; } - // for Teredo-tunneled IPv6 addresses, use the encapsulated IPv4 address + // for Teredo-tunnelled IPv6 addresses, use the encapsulated IPv4 address else if (IsRFC4380()) { vchRet.push_back(1); diff --git a/src/netbase.h b/src/netbase.h index 24e94f2a2da..2543a022489 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -45,9 +45,9 @@ class CNetAddr bool IsRFC1918() const; // IPv4 private networks (10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12) bool IsRFC3849() const; // IPv6 documentation address (2001:0DB8::/32) bool IsRFC3927() const; // IPv4 autoconfig (169.254.0.0/16) - bool IsRFC3964() const; // IPv6 6to4 tunneling (2002::/16) + bool IsRFC3964() const; // IPv6 6to4 tunnelling (2002::/16) bool IsRFC4193() const; // IPv6 unique local (FC00::/15) - bool IsRFC4380() const; // IPv6 Teredo tunneling (2001::/32) + bool IsRFC4380() const; // IPv6 Teredo tunnelling (2001::/32) bool IsRFC4843() const; // IPv6 ORCHID (2001:10::/28) bool IsRFC4862() const; // IPv6 autoconfig (FE80::/64) bool IsRFC6052() const; // IPv6 well-known prefix (64:FF9B::/96) diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index ddf7aa95a5b..d08e8d6aa0b 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -269,7 +269,7 @@ int main(int argc, char *argv[]) window.show(); } - // Place this here as guiref has to be defined if we dont want to lose URIs + // Place this here as guiref has to be defined if we don't want to lose URIs ipcInit(); #if !defined(MAC_OSX) && !defined(WIN32) diff --git a/src/script.cpp b/src/script.cpp index 6a5f3f78e76..1fc53440d98 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -1195,7 +1195,7 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector& multisigdata, const CKeyStore& keystore, uint2 // Sign scriptPubKey with private keys stored in keystore, given transaction hash and hash type. // Signatures are returned in scriptSigRet (or returns false if scriptPubKey can't be signed), // unless whichTypeRet is TX_SCRIPTHASH, in which case scriptSigRet is the redemption script. -// Returns false if scriptPubKey could not be completely satisified. +// Returns false if scriptPubKey could not be completely satisfied. // bool Solver(const CKeyStore& keystore, const CScript& scriptPubKey, uint256 hash, int nHashType, CScript& scriptSigRet, txnouttype& whichTypeRet) diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index aa72c00092c..b84b9037213 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -130,7 +130,7 @@ BOOST_AUTO_TEST_CASE(norecurse) // Should not verify, because it will try to execute OP_INVALIDOPCODE BOOST_CHECK(!Verify(scriptSig, p2sh, true)); - // Try to recurse, and verification should succeed because + // Try to recur, and verification should succeed because // the inner HASH160 <> EQUAL should only check the hash: CScript p2sh2; p2sh2.SetPayToScriptHash(p2sh); @@ -225,7 +225,7 @@ BOOST_AUTO_TEST_CASE(is) BOOST_AUTO_TEST_CASE(switchover) { - // Test switchover code + // Test switch over code CScript notValid; notValid << OP_11 << OP_12 << OP_EQUALVERIFY; CScript scriptSig;