From: CryptoManiac Date: Sun, 13 Mar 2016 15:19:38 +0000 (+0300) Subject: Fix compilation warnings. X-Git-Tag: nvc-v0.5.6~9 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=1d40b6207e7d1591c47cce149aae84bb60dcc416 Fix compilation warnings. --- diff --git a/novacoin-qt.pro b/novacoin-qt.pro index 28df511..8643309 100644 --- a/novacoin-qt.pro +++ b/novacoin-qt.pro @@ -9,6 +9,9 @@ CONFIG += no_include_pwd CONFIG += thread CONFIG += static +#QMAKE_CC=clang +#QMAKE_CXX=clang++ + freebsd-g++: QMAKE_TARGET.arch = $$QMAKE_HOST.arch linux-g++: QMAKE_TARGET.arch = $$QMAKE_HOST.arch linux-g++-32: QMAKE_TARGET.arch = i686 diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp index 94eaad2..48112a5 100644 --- a/src/rpcdump.cpp +++ b/src/rpcdump.cpp @@ -285,7 +285,7 @@ Value importmalleablekey(const Array& params, bool fHelp) if (fSuccess) { - fSuccess = pwalletMain->AddMalleableKey(mKey); + fSuccess = pwalletMain->AddKey(mKey); result.push_back(Pair("Successful", fSuccess)); result.push_back(Pair("Address", CBitcoinAddress(mKey.GetMalleablePubKey()).ToString())); result.push_back(Pair("KeyView", CMalleableKeyView(mKey).ToString())); diff --git a/src/wallet.cpp b/src/wallet.cpp index b484ab6..2ee7dfa 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -74,8 +74,8 @@ CMalleableKeyView CWallet::GenerateNewMalleableKey() if (!nTimeFirstKey || nCreationTime < nTimeFirstKey) nTimeFirstKey = nCreationTime; - if (!AddMalleableKey(mKey)) - throw std::runtime_error("CWallet::GenerateNewMalleableKey() : AddMalleableKey failed"); + if (!AddKey(mKey)) + throw std::runtime_error("CWallet::GenerateNewMalleableKey() : AddKey failed"); return CMalleableKeyView(mKey); } @@ -91,7 +91,7 @@ bool CWallet::AddKey(const CKey& key) return true; } -bool CWallet::AddMalleableKey(const CMalleableKey& mKey) +bool CWallet::AddKey(const CMalleableKey& mKey) { CMalleableKeyView keyView = CMalleableKeyView(mKey); CSecret vchSecretH = mKey.GetSecretH(); diff --git a/src/wallet.h b/src/wallet.h index 2dffd04..fb02d02 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -158,7 +158,7 @@ public: CMalleableKeyView GenerateNewMalleableKey(); // Adds a key to the store, and saves it to disk. bool AddKey(const CKey& key); - bool AddMalleableKey(const CMalleableKey& mKey); + bool AddKey(const CMalleableKey& mKey); // Adds a key to the store, without saving it to disk (used by LoadWallet) bool LoadKey(const CKey& key) { return CCryptoKeyStore::AddKey(key); } // Load metadata (used by LoadWallet) @@ -166,8 +166,8 @@ public: bool LoadKeyMetadata(const CMalleableKeyView &keyView, const CKeyMetadata &metadata); // Load malleable key without saving it to disk (used by LoadWallet) - bool LoadMalleableKey(const CMalleableKeyView &keyView, const CSecret &vchSecretH) { return CCryptoKeyStore::AddMalleableKey(keyView, vchSecretH); } - bool LoadCryptedMalleableKey(const CMalleableKeyView &keyView, const std::vector &vchCryptedSecretH) { return CCryptoKeyStore::AddCryptedMalleableKey(keyView, vchCryptedSecretH); } + bool LoadKey(const CMalleableKeyView &keyView, const CSecret &vchSecretH) { return CCryptoKeyStore::AddMalleableKey(keyView, vchSecretH); } + bool LoadCryptedKey(const CMalleableKeyView &keyView, const std::vector &vchCryptedSecretH) { return CCryptoKeyStore::AddCryptedMalleableKey(keyView, vchCryptedSecretH); } bool LoadMinVersion(int nVersion) { nWalletVersion = nVersion; nWalletMaxVersion = std::max(nWalletMaxVersion, nVersion); return true; } diff --git a/src/walletdb.cpp b/src/walletdb.cpp index e44885d..640f78b 100644 --- a/src/walletdb.cpp +++ b/src/walletdb.cpp @@ -311,9 +311,9 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, ssValue >> vchSecret; CMalleableKeyView keyView(strKeyView); - if (!pwallet->LoadMalleableKey(keyView, vchSecret)) + if (!pwallet->LoadKey(keyView, vchSecret)) { - strErr = "Error reading wallet database: LoadMalleableKey failed"; + strErr = "Error reading wallet database: LoadKey failed"; return false; } } @@ -326,9 +326,9 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, ssValue >> vchCryptedSecret; CMalleableKeyView keyView(strKeyView); - if (!pwallet->LoadCryptedMalleableKey(keyView, vchCryptedSecret)) + if (!pwallet->LoadCryptedKey(keyView, vchCryptedSecret)) { - strErr = "Error reading wallet database: LoadCryptedMalleableKey failed"; + strErr = "Error reading wallet database: LoadCryptedKey failed"; return false; } } @@ -940,7 +940,7 @@ bool ImportWallet(CWallet *pwallet, const string& strLocation) } printf("Importing %s...\n", addr.ToString().c_str()); - if (!pwallet->AddMalleableKey(mKey)) { + if (!pwallet->AddKey(mKey)) { fGood = false; continue; }