From 0e31e5631c279353564f6407b8950b1224cf5b9f Mon Sep 17 00:00:00 2001 From: Kamil Domanski Date: Tue, 13 May 2014 20:48:34 +0200 Subject: remove CWallet::AddReserveKey which is never used --- src/wallet.cpp | 15 --------------- src/wallet.h | 1 - 2 files changed, 16 deletions(-) diff --git a/src/wallet.cpp b/src/wallet.cpp index fa7aecddb6..89604f96ac 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1671,21 +1671,6 @@ void CWallet::ReserveKeyFromKeyPool(int64_t& nIndex, CKeyPool& keypool) } } -int64_t CWallet::AddReserveKey(const CKeyPool& keypool) -{ - { - LOCK2(cs_main, cs_wallet); - CWalletDB walletdb(strWalletFile); - - int64_t nIndex = 1 + *(--setKeyPool.end()); - if (!walletdb.WritePool(nIndex, keypool)) - throw runtime_error("AddReserveKey() : writing added key failed"); - setKeyPool.insert(nIndex); - return nIndex; - } - return -1; -} - void CWallet::KeepKey(int64_t nIndex) { // Remove from key pool diff --git a/src/wallet.h b/src/wallet.h index b2c06d3f61..5e9af191cc 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -263,7 +263,6 @@ public: bool NewKeyPool(); bool TopUpKeyPool(unsigned int kpSize = 0); - int64_t AddReserveKey(const CKeyPool& keypool); void ReserveKeyFromKeyPool(int64_t& nIndex, CKeyPool& keypool); void KeepKey(int64_t nIndex); void ReturnKey(int64_t nIndex); -- cgit v1.2.3 From f4057cb749f4c0d04bf936805ff8aa5678b9c6f2 Mon Sep 17 00:00:00 2001 From: Kamil Domanski Date: Tue, 13 May 2014 20:58:25 +0200 Subject: remove CTransaction::IsNewerThan which is never used --- src/core.cpp | 29 ----------------------------- src/core.h | 1 - 2 files changed, 30 deletions(-) diff --git a/src/core.cpp b/src/core.cpp index 7651ce9957..aadcb44b98 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -77,35 +77,6 @@ uint256 CTransaction::GetHash() const return SerializeHash(*this); } -bool CTransaction::IsNewerThan(const CTransaction& old) const -{ - if (vin.size() != old.vin.size()) - return false; - for (unsigned int i = 0; i < vin.size(); i++) - if (vin[i].prevout != old.vin[i].prevout) - return false; - - bool fNewer = false; - unsigned int nLowest = std::numeric_limits::max(); - for (unsigned int i = 0; i < vin.size(); i++) - { - if (vin[i].nSequence != old.vin[i].nSequence) - { - if (vin[i].nSequence <= nLowest) - { - fNewer = false; - nLowest = vin[i].nSequence; - } - if (old.vin[i].nSequence < nLowest) - { - fNewer = true; - nLowest = old.vin[i].nSequence; - } - } - } - return fNewer; -} - int64_t CTransaction::GetValueOut() const { int64_t nValueOut = 0; diff --git a/src/core.h b/src/core.h index 5eb953610d..ba7f691119 100644 --- a/src/core.h +++ b/src/core.h @@ -219,7 +219,6 @@ public: } uint256 GetHash() const; - bool IsNewerThan(const CTransaction& old) const; // Return sum of txouts. int64_t GetValueOut() const; -- cgit v1.2.3 From 595f691d0acd871ecaba323d888a3632805c1828 Mon Sep 17 00:00:00 2001 From: Kamil Domanski Date: Tue, 13 May 2014 21:00:16 +0200 Subject: remove LogException( ) which is never used --- src/util.cpp | 6 ------ src/util.h | 2 -- 2 files changed, 8 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index aa3adf89ec..d99e6a7bfb 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -885,12 +885,6 @@ static std::string FormatException(std::exception* pex, const char* pszThread) "UNKNOWN EXCEPTION \n%s in %s \n", pszModule, pszThread); } -void LogException(std::exception* pex, const char* pszThread) -{ - std::string message = FormatException(pex, pszThread); - LogPrintf("\n%s", message); -} - void PrintExceptionContinue(std::exception* pex, const char* pszThread) { std::string message = FormatException(pex, pszThread); diff --git a/src/util.h b/src/util.h index 97185073e0..dc0c3a8cae 100644 --- a/src/util.h +++ b/src/util.h @@ -151,8 +151,6 @@ static inline bool error(const char* format) return false; } - -void LogException(std::exception* pex, const char* pszThread); void PrintExceptionContinue(std::exception* pex, const char* pszThread); std::string FormatMoney(int64_t n, bool fPlus=false); bool ParseMoney(const std::string& str, int64_t& nRet); -- cgit v1.2.3 From 5bd4adca716738a4de35aed2ccad874d3301fefc Mon Sep 17 00:00:00 2001 From: Kamil Domanski Date: Tue, 13 May 2014 21:02:17 +0200 Subject: remove LookupHostNumeric( ) which is never used --- src/netbase.cpp | 5 ----- src/netbase.h | 1 - 2 files changed, 6 deletions(-) diff --git a/src/netbase.cpp b/src/netbase.cpp index 82a681281d..c72d777e3d 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -123,11 +123,6 @@ bool LookupHost(const char *pszName, std::vector& vIP, unsigned int nM return LookupIntern(strHost.c_str(), vIP, nMaxSolutions, fAllowLookup); } -bool LookupHostNumeric(const char *pszName, std::vector& vIP, unsigned int nMaxSolutions) -{ - return LookupHost(pszName, vIP, nMaxSolutions, false); -} - bool Lookup(const char *pszName, std::vector& vAddr, int portDefault, bool fAllowLookup, unsigned int nMaxSolutions) { if (pszName[0] == 0) diff --git a/src/netbase.h b/src/netbase.h index 118f866d6c..35547b2660 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -173,7 +173,6 @@ bool IsProxy(const CNetAddr &addr); bool SetNameProxy(CService addrProxy, int nSocksVersion = 5); bool HaveNameProxy(); bool LookupHost(const char *pszName, std::vector& vIP, unsigned int nMaxSolutions = 0, bool fAllowLookup = true); -bool LookupHostNumeric(const char *pszName, std::vector& vIP, unsigned int nMaxSolutions = 0); bool Lookup(const char *pszName, CService& addr, int portDefault = 0, bool fAllowLookup = true); bool Lookup(const char *pszName, std::vector& vAddr, int portDefault = 0, bool fAllowLookup = true, unsigned int nMaxSolutions = 0); bool LookupNumeric(const char *pszName, CService& addr, int portDefault = 0); -- cgit v1.2.3 From 28b6c1def57360ca5a05745faafaec53910f5e88 Mon Sep 17 00:00:00 2001 From: Kamil Domanski Date: Tue, 13 May 2014 21:37:47 +0200 Subject: remove GetMedianTime( ) which is never used --- src/main.cpp | 13 ------------- src/main.h | 2 -- 2 files changed, 15 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index c54fa65233..126b4ada51 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2575,19 +2575,6 @@ bool CBlockIndex::IsSuperMajority(int minVersion, const CBlockIndex* pstart, uns return (nFound >= nRequired); } -int64_t CBlockIndex::GetMedianTime() const -{ - AssertLockHeld(cs_main); - const CBlockIndex* pindex = this; - for (int i = 0; i < nMedianTimeSpan/2; i++) - { - if (!chainActive.Next(pindex)) - return GetBlockTime(); - pindex = chainActive.Next(pindex); - } - return pindex->GetMedianTimePast(); -} - void PushGetBlocks(CNode* pnode, CBlockIndex* pindexBegin, uint256 hashEnd) { AssertLockHeld(cs_main); diff --git a/src/main.h b/src/main.h index f47c9ee825..25f70e7ad4 100644 --- a/src/main.h +++ b/src/main.h @@ -849,8 +849,6 @@ public: return pbegin[(pend - pbegin)/2]; } - int64_t GetMedianTime() const; - /** * Returns true if there are nRequired or more blocks of minVersion or above * in the last nToCheck blocks, starting at pstart and going backwards. -- cgit v1.2.3 From f40dbeedde3a6a73c13b0241258cf23248db1de1 Mon Sep 17 00:00:00 2001 From: Kamil Domanski Date: Tue, 13 May 2014 21:41:51 +0200 Subject: remove CPubKey::VerifyCompact( ) which is never used --- src/key.cpp | 15 --------------- src/key.h | 4 ---- 2 files changed, 19 deletions(-) diff --git a/src/key.cpp b/src/key.cpp index 2199996cf3..aa24f0a622 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -485,21 +485,6 @@ bool CPubKey::RecoverCompact(const uint256 &hash, const std::vector& vchSig) const { - if (!IsValid()) - return false; - if (vchSig.size() != 65) - return false; - CECKey key; - if (!key.Recover(hash, &vchSig[1], (vchSig[0] - 27) & ~4)) - return false; - CPubKey pubkeyRec; - key.GetPubKey(pubkeyRec, IsCompressed()); - if (*this != pubkeyRec) - return false; - return true; -} - bool CPubKey::IsFullyValid() const { if (!IsValid()) return false; diff --git a/src/key.h b/src/key.h index 37a06810b4..983775fd23 100644 --- a/src/key.h +++ b/src/key.h @@ -156,10 +156,6 @@ public: // If this public key is not fully valid, the return value will be false. bool Verify(const uint256 &hash, const std::vector& vchSig) const; - // Verify a compact signature (~65 bytes). - // See CKey::SignCompact. - bool VerifyCompact(const uint256 &hash, const std::vector& vchSig) const; - // Recover a public key from a compact signature. bool RecoverCompact(const uint256 &hash, const std::vector& vchSig); -- cgit v1.2.3