diff options
-rw-r--r-- | src/base58.h | 2 | ||||
-rw-r--r-- | src/bitcoinrpc.cpp | 2 | ||||
-rw-r--r-- | src/crypter.cpp | 2 | ||||
-rw-r--r-- | src/irc.cpp | 8 | ||||
-rw-r--r-- | src/key.h | 4 | ||||
-rw-r--r-- | src/main.cpp | 15 | ||||
-rw-r--r-- | src/net.cpp | 4 | ||||
-rw-r--r-- | src/net.h | 2 | ||||
-rw-r--r-- | src/qt/csvmodelwriter.cpp | 2 | ||||
-rw-r--r-- | src/qt/optionsmodel.cpp | 2 | ||||
-rw-r--r-- | src/qt/sendcoinsentry.cpp | 8 | ||||
-rw-r--r-- | src/uint256.h | 1 |
12 files changed, 34 insertions, 18 deletions
diff --git a/src/base58.h b/src/base58.h index 7fefbc5d74..90ce34b05b 100644 --- a/src/base58.h +++ b/src/base58.h @@ -288,7 +288,7 @@ public: bool IsValid() const { - int nExpectedSize = 20; + unsigned int nExpectedSize = 20; bool fExpectTestNet = false; switch(nVersion) { diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index ab4238fbb7..b80708dab4 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -203,7 +203,7 @@ Value help(const Array& params, bool fHelp) // Help text is returned in an exception string strHelp = string(e.what()); if (strCommand == "") - if (strHelp.find('\n') != -1) + if (strHelp.find('\n') != string::npos) strHelp = strHelp.substr(0, strHelp.find('\n')); strRet += strHelp + "\n"; } diff --git a/src/crypter.cpp b/src/crypter.cpp index 83041addb4..2501305edc 100644 --- a/src/crypter.cpp +++ b/src/crypter.cpp @@ -31,7 +31,7 @@ bool CCrypter::SetKeyFromPassphrase(const SecureString& strKeyData, const std::v i = EVP_BytesToKey(EVP_aes_256_cbc(), EVP_sha512(), &chSalt[0], (unsigned char *)&strKeyData[0], strKeyData.size(), nRounds, chKey, chIV); - if (i != WALLET_CRYPTO_KEY_SIZE) + if (i != (int)WALLET_CRYPTO_KEY_SIZE) { memset(&chKey, 0, sizeof chKey); memset(&chIV, 0, sizeof chIV); diff --git a/src/irc.cpp b/src/irc.cpp index 09bacc1658..d535f59c4c 100644 --- a/src/irc.cpp +++ b/src/irc.cpp @@ -108,13 +108,13 @@ int RecvUntil(SOCKET hSocket, const char* psz1, const char* psz2=NULL, const cha if (!RecvLineIRC(hSocket, strLine)) return 0; printf("IRC %s\n", strLine.c_str()); - if (psz1 && strLine.find(psz1) != -1) + if (psz1 && strLine.find(psz1) != string::npos) return 1; - if (psz2 && strLine.find(psz2) != -1) + if (psz2 && strLine.find(psz2) != string::npos) return 2; - if (psz3 && strLine.find(psz3) != -1) + if (psz3 && strLine.find(psz3) != string::npos) return 3; - if (psz4 && strLine.find(psz4) != -1) + if (psz4 && strLine.find(psz4) != string::npos) return 4; } } @@ -173,7 +173,7 @@ public: CPrivKey GetPrivKey() const { - unsigned int nSize = i2d_ECPrivateKey(pkey, NULL); + int nSize = i2d_ECPrivateKey(pkey, NULL); if (!nSize) throw key_error("CKey::GetPrivKey() : i2d_ECPrivateKey failed"); CPrivKey vchPrivKey(nSize, 0); @@ -196,7 +196,7 @@ public: std::vector<unsigned char> GetPubKey() const { - unsigned int nSize = i2o_ECPublicKey(pkey, NULL); + int nSize = i2o_ECPublicKey(pkey, NULL); if (!nSize) throw key_error("CKey::GetPubKey() : i2o_ECPublicKey failed"); std::vector<unsigned char> vchPubKey(nSize, 0); diff --git a/src/main.cpp b/src/main.cpp index e2310b8494..2473662620 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2141,7 +2141,18 @@ bool static AlreadyHave(CTxDB& txdb, const CInv& inv) { switch (inv.type) { - case MSG_TX: return mapTransactions.count(inv.hash) || mapOrphanTransactions.count(inv.hash) || txdb.ContainsTx(inv.hash); + case MSG_TX: + { + bool txInMap = false; + CRITICAL_BLOCK(cs_mapTransactions) + { + txInMap = (mapTransactions.count(inv.hash) != 0); + } + return txInMap || + mapOrphanTransactions.count(inv.hash) || + txdb.ContainsTx(inv.hash); + } + case MSG_BLOCK: return mapBlockIndex.count(inv.hash) || mapOrphanBlocks.count(inv.hash); } // Don't know what it is, just say we already got one @@ -2806,7 +2817,7 @@ bool ProcessMessages(CNode* pfrom) bool SendMessages(CNode* pto, bool fSendTrickle) { - CRITICAL_BLOCK(cs_main) + TRY_CRITICAL_BLOCK(cs_main) { // Don't send anything until we get their version message if (pto->nVersion == 0) diff --git a/src/net.cpp b/src/net.cpp index c4bd027de2..5368261243 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -159,14 +159,14 @@ bool GetMyExternalIP2(const CService& addrConnect, const char* pszGet, const cha } if (pszKeyword == NULL) break; - if (strLine.find(pszKeyword) != -1) + if (strLine.find(pszKeyword) != string::npos) { strLine = strLine.substr(strLine.find(pszKeyword) + strlen(pszKeyword)); break; } } closesocket(hSocket); - if (strLine.find("<") != -1) + if (strLine.find("<") != string::npos) strLine = strLine.substr(0, strLine.find("<")); strLine = strLine.substr(strspn(strLine.c_str(), " \t\n\r")); while (strLine.size() > 0 && isspace(strLine[strLine.size()-1])) @@ -120,7 +120,7 @@ public: int64 nLastRecv; int64 nLastSendEmpty; int64 nTimeConnected; - unsigned int nHeaderStart; + signed int nHeaderStart; unsigned int nMessageStart; CAddress addr; int nVersion; diff --git a/src/qt/csvmodelwriter.cpp b/src/qt/csvmodelwriter.cpp index 4b21b8c4be..84578b3322 100644 --- a/src/qt/csvmodelwriter.cpp +++ b/src/qt/csvmodelwriter.cpp @@ -6,7 +6,7 @@ CSVModelWriter::CSVModelWriter(const QString &filename, QObject *parent) : QObject(parent), - filename(filename) + filename(filename), model(0) { } diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index ed2225cbf5..71defc195a 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -198,10 +198,12 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in settings.setValue("nDisplayUnit", nDisplayUnit); emit displayUnitChanged(unit); } + break; case DisplayAddresses: { bDisplayAddresses = value.toBool(); settings.setValue("bDisplayAddresses", bDisplayAddresses); } + break; default: break; } diff --git a/src/qt/sendcoinsentry.cpp b/src/qt/sendcoinsentry.cpp index caffaaeff2..c8242d8352 100644 --- a/src/qt/sendcoinsentry.cpp +++ b/src/qt/sendcoinsentry.cpp @@ -59,9 +59,11 @@ void SendCoinsEntry::on_payTo_textChanged(const QString &address) { if(!model) return; - // Fill in label from address book, if no label is filled in yet - if(ui->addAsLabel->text().isEmpty()) - ui->addAsLabel->setText(model->getAddressTableModel()->labelForAddress(address));} + // Fill in label from address book, if address has an associated label + QString associatedLabel = model->getAddressTableModel()->labelForAddress(address); + if(!associatedLabel.isEmpty()) + ui->addAsLabel->setText(associatedLabel); +} void SendCoinsEntry::setModel(WalletModel *model) { diff --git a/src/uint256.h b/src/uint256.h index a65a2e496d..6215b9630e 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -8,6 +8,7 @@ #include "serialize.h" #include <limits.h> +#include <stdio.h> #include <string> #include <vector> |