diff -uNr a/bitcoin/src/db.cpp b/bitcoin/src/db.cpp --- a/bitcoin/src/db.cpp 565faf3ef371f5e2178ae30c45b08b93415eeb92263486e68f2ac2e8f4c7900056e628804bf5c0707a90be946e0aeaebfcd0a391aab40de2e5d56e6bcbdccb1e +++ b/bitcoin/src/db.cpp 6e74d6c678fa143cc5079da39676694183ddd3bc53cb09c0667ba4ec3e33b3380746b04dcc07725147866a2c81185ec497fd8c9e591c5cf2e0136bd9762c71eb @@ -337,16 +337,6 @@ return Write(make_pair(string("tx"), hash), txindex); } -bool CTxDB::AddTxIndex(const CTransaction& tx, const CDiskTxPos& pos, int nHeight) -{ - assert(!fClient); - - // Add to tx index - uint256 hash = tx.GetHash(); - CTxIndex txindex(pos, tx.vout.size()); - return Write(make_pair(string("tx"), hash), txindex); -} - bool CTxDB::EraseTxIndex(const CTransaction& tx) { assert(!fClient); @@ -361,60 +351,6 @@ return Exists(make_pair(string("tx"), hash)); } -bool CTxDB::ReadOwnerTxes(uint160 hash160, int nMinHeight, vector& vtx) -{ - assert(!fClient); - vtx.clear(); - - // Get cursor - Dbc* pcursor = GetCursor(); - if (!pcursor) - return false; - - unsigned int fFlags = DB_SET_RANGE; - loop - { - // Read next record - CDataStream ssKey; - if (fFlags == DB_SET_RANGE) - ssKey << string("owner") << hash160 << CDiskTxPos(0, 0, 0); - CDataStream ssValue; - int ret = ReadAtCursor(pcursor, ssKey, ssValue, fFlags); - fFlags = DB_NEXT; - if (ret == DB_NOTFOUND) - break; - else if (ret != 0) - { - pcursor->close(); - return false; - } - - // Unserialize - string strType; - uint160 hashItem; - CDiskTxPos pos; - ssKey >> strType >> hashItem >> pos; - int nItemHeight; - ssValue >> nItemHeight; - - // Read transaction - if (strType != "owner" || hashItem != hash160) - break; - if (nItemHeight >= nMinHeight) - { - vtx.resize(vtx.size()+1); - if (!vtx.back().ReadFromDisk(pos)) - { - pcursor->close(); - return false; - } - } - } - - pcursor->close(); - return true; -} - bool CTxDB::ReadDiskTx(uint256 hash, CTransaction& tx, CTxIndex& txindex) { assert(!fClient); @@ -446,11 +382,6 @@ return Write(make_pair(string("blockindex"), blockindex.GetBlockHash()), blockindex); } -bool CTxDB::EraseBlockIndex(uint256 hash) -{ - return Erase(make_pair(string("blockindex"), hash)); -} - bool CTxDB::ReadHashBestChain(uint256& hashBestChain) { return Read(string("hashBestChain"), hashBestChain); @@ -684,14 +615,6 @@ return Write(make_pair(string("name"), strAddress), strName); } -bool CWalletDB::EraseName(const string& strAddress) -{ - // This should only be used for sending addresses, never for receiving addresses, - // receiving addresses must always have an address book entry if they're not change return. - nWalletDBUpdated++; - return Erase(make_pair(string("name"), strAddress)); -} - bool CWalletDB::ReadAccount(const string& strAccount, CAccount& account) { account.SetNull(); diff -uNr a/bitcoin/src/db.h b/bitcoin/src/db.h --- a/bitcoin/src/db.h 1a4b9bd666180acf944d189ffd5b89da0f1c0d7b60223fe7f16f73a7d90bdd2a75b7d46805738ea3da36ae766b0aa4a5d29283b5f4ef8a77aae991cf990ae0cc +++ b/bitcoin/src/db.h b3be33188004f15109afe4fd5d46b12f5b816f60581033de633a2fb58e38872abe886da63ccf4be605c152d7d31c0b341c4323d9c9b377736b094000479b489d @@ -276,16 +276,13 @@ public: bool ReadTxIndex(uint256 hash, CTxIndex& txindex); bool UpdateTxIndex(uint256 hash, const CTxIndex& txindex); - bool AddTxIndex(const CTransaction& tx, const CDiskTxPos& pos, int nHeight); bool EraseTxIndex(const CTransaction& tx); bool ContainsTx(uint256 hash); - bool ReadOwnerTxes(uint160 hash160, int nHeight, std::vector& vtx); bool ReadDiskTx(uint256 hash, CTransaction& tx, CTxIndex& txindex); bool ReadDiskTx(uint256 hash, CTransaction& tx); bool ReadDiskTx(COutPoint outpoint, CTransaction& tx, CTxIndex& txindex); bool ReadDiskTx(COutPoint outpoint, CTransaction& tx); bool WriteBlockIndex(const CDiskBlockIndex& blockindex); - bool EraseBlockIndex(uint256 hash); bool ReadHashBestChain(uint256& hashBestChain); bool WriteHashBestChain(uint256 hashBestChain); bool ReadBestInvalidWork(CBigNum& bnBestInvalidWork); @@ -370,8 +367,6 @@ bool WriteName(const std::string& strAddress, const std::string& strName); - bool EraseName(const std::string& strAddress); - bool ReadTx(uint256 hash, CWalletTx& wtx) { return Read(std::make_pair(std::string("tx"), hash), wtx); diff -uNr a/bitcoin/src/main.cpp b/bitcoin/src/main.cpp --- a/bitcoin/src/main.cpp 738ea5d28c72b586790716c124d219b8b132c5224ce07cc3b47eab4495e2c9009eae1a7d7fa3faaa24de465d5a46201dc1c4a468ab5a891cb59811d328b82084 +++ b/bitcoin/src/main.cpp d6ce64a096a9d9369e4337a2f6a93fd23c6795c37c3a73d67129e19716b140a6acba095aad6e58133f37a3566d651ba09cd98dfff3eccfc205d89f1e3dab1a3a @@ -700,12 +700,6 @@ return true; } -// Return maximum amount of blocks that other nodes claim to have -int GetNumBlocksOfPeers() -{ - return std::max(cPeerBlockCounts.median(), Checkpoints::GetTotalBlocksEstimate()); -} - bool IsInitialBlockDownload() { if (pindexBest == NULL || nBestHeight < Checkpoints::GetTotalBlocksEstimate()) diff -uNr a/bitcoin/src/main.h b/bitcoin/src/main.h --- a/bitcoin/src/main.h 854e85a8217f8386fa7ec13775fdf7271a41a0132816f1a64acd40904b4b8300491dd368a26648afb11af019f0bdcc535ca327c19eaca698803f3afdd57b76d8 +++ b/bitcoin/src/main.h e67950ce70db55dbbc803087815c8fe19e971fe3841dfd374101f7eb9c8c7307b88e30bc19a0f0fa41980eb0acfae47bd3a53fd55c768dc12699d159c4cd6adb @@ -96,7 +96,6 @@ bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey); bool CheckProofOfWork(uint256 hash, unsigned int nBits); unsigned int ComputeMinWork(unsigned int nBase, int64 nTime); -int GetNumBlocksOfPeers(); bool IsInitialBlockDownload(); std::string GetWarnings(std::string strFor); diff -uNr a/bitcoin/src/net.cpp b/bitcoin/src/net.cpp --- a/bitcoin/src/net.cpp 264576d0885cfb6145807d8920b7dcc3affef23ff3e45ce7138c156106c80d47d76c9485285203e5570926e51b98c8d0abe2142160e2f5016a8e24c81773da35 +++ b/bitcoin/src/net.cpp dc90dbf0935253a945e0a6dcdf00d9205b7c34fa20858cd8d31c7d76b8b712f209db9f8e912066174552e5057d561d10e21a459a47bb1aa69be1c59668cf52ec @@ -325,39 +325,6 @@ } } - - - - -void AbandonRequests(void (*fn)(void*, CDataStream&), void* param1) -{ - // If the dialog might get closed before the reply comes back, - // call this in the destructor so it doesn't get called after it's deleted. - CRITICAL_BLOCK(cs_vNodes) - { - BOOST_FOREACH(CNode* pnode, vNodes) - { - CRITICAL_BLOCK(pnode->cs_mapRequests) - { - for (map::iterator mi = pnode->mapRequests.begin(); mi != pnode->mapRequests.end();) - { - CRequestTracker& tracker = (*mi).second; - if (tracker.fn == fn && tracker.param1 == param1) - pnode->mapRequests.erase(mi++); - else - mi++; - } - } - } - } -} - - - - - - - // // Subscription methods for the broadcast and subscription system. // Channel numbers are message numbers, i.e. MSG_TABLE and MSG_PRODUCT. diff -uNr a/bitcoin/src/net.h b/bitcoin/src/net.h --- a/bitcoin/src/net.h 77ede4a59510c44c7167144c78cc0608430c50ff25b28201eb39ee69b0d4acbcce7374c4efd254304732c409b5799bc59557c3cb69a29c9f7c29ddd3d9e3a4a6 +++ b/bitcoin/src/net.h fab371f9626c49ce609809c549a7ab1c2b91ce4cc113f279b3f84de5f9eaf009041ac47c0332515cfea8bb7a148f854544db1f9dd282d7c501ae011670a5580c @@ -32,7 +32,6 @@ void AddressCurrentlyConnected(const CAddress& addr); CNode* FindNode(unsigned int ip); CNode* ConnectNode(CAddress addrConnect, int64 nTimeout=0); -void AbandonRequests(void (*fn)(void*, CDataStream&), void* param1); bool AnySubscribed(unsigned int nChannel); void MapPort(bool fMapPort); bool BindListenPort(std::string& strError=REF(std::string())); diff -uNr a/bitcoin/src/protocol.cpp b/bitcoin/src/protocol.cpp --- a/bitcoin/src/protocol.cpp 35effbc7f73cdbda92148be58171b2337c090a7997eb3b02daf9a88287b4315c80d7fa5edf403be9cf958969c0c7e0c1b578c10f146ee0ea9b2965a1f97971bf +++ b/bitcoin/src/protocol.cpp 1ce6a800dfbd7280e562726db960b56682ea07111c04403b9eaff1a1b161ae36892589edb68a78a58abc1daa615e7b13841e2161efc30423da28174a2cba8936 @@ -235,11 +235,6 @@ return strprintf("%u.%u.%u.%u", GetByte(3), GetByte(2), GetByte(1), GetByte(0)); } -std::string CAddress::ToStringPort() const -{ - return strprintf("%u", ntohs(port)); -} - std::string CAddress::ToString() const { return strprintf("%u.%u.%u.%u:%u", GetByte(3), GetByte(2), GetByte(1), GetByte(0), ntohs(port)); diff -uNr a/bitcoin/src/protocol.h b/bitcoin/src/protocol.h --- a/bitcoin/src/protocol.h cce0473250e39dd85773246ea0cd40584c77daa7fcba7ff98836d8b9bdbff2f3e229f385c43c73503ca9e244219708b2299600db28d1d7df442c92f22ed74485 +++ b/bitcoin/src/protocol.h 5cd66e02b5ff673642507374b2ff5c96561f99cba772051f682ffbdde4baece997b0568893594901f381b54fe849bb8ddff4ecadcba77e853b9feef8b42ab2b4 @@ -102,7 +102,6 @@ unsigned char GetByte(int n) const; std::string ToStringIPPort() const; std::string ToStringIP() const; - std::string ToStringPort() const; std::string ToString() const; void print() const; diff -uNr a/bitcoin/src/util.cpp b/bitcoin/src/util.cpp --- a/bitcoin/src/util.cpp 568ca27a4f90dc47f125880f64ee42dfeb0493a5e0ef79e314c3df1702920c21d7aea35cf197916a9881b569500c815d09e932f4668deef84507a26d7557b1cf +++ b/bitcoin/src/util.cpp 1fe4cc7cbac17e970d7b7447dcab58de06ab46715efb5b9d4f9425a865c0ef98f81971831b9c1e6979f3598f813c0305911f4faefde31ec9d3cec5f9b9909c5e @@ -251,27 +251,6 @@ return false; } - -void ParseString(const string& str, char c, vector& v) -{ - if (str.empty()) - return; - string::size_type i1 = 0; - string::size_type i2; - loop - { - i2 = str.find(c, i1); - if (i2 == str.npos) - { - v.push_back(str.substr(i1)); - return; - } - v.push_back(str.substr(i1, i2-i1)); - i1 = i2+1; - } -} - - string FormatMoney(int64 n, bool fPlus) { // Note: not using straight sprintf here because we do NOT want @@ -612,13 +591,6 @@ "UNKNOWN EXCEPTION \n%s in %s \n", pszModule, pszThread); } -void LogException(std::exception* pex, const char* pszThread) -{ - char pszMessage[10000]; - FormatException(pszMessage, pex, pszThread); - printf("\n%s", pszMessage); -} - void PrintException(std::exception* pex, const char* pszThread) { char pszMessage[10000]; diff -uNr a/bitcoin/src/util.h b/bitcoin/src/util.h --- a/bitcoin/src/util.h b171f0824811472edb2e309537b772583a32b678550080f257d4b535bb62f46c04aaf0047d29500df6ca77a7e2c01d729b4536b7b7869061863012e39b6c026f +++ b/bitcoin/src/util.h cb1009f55483c5e1ebc36b4916f7de386fe6bc827feb96f018d123058775822469315f57e21c9b73ec8b745724d96fc1fc106cccf1905c4ed85e0bef3c72e820 @@ -132,10 +132,8 @@ int my_snprintf(char* buffer, size_t limit, const char* format, ...); std::string strprintf(const std::string &format, ...); bool error(const std::string &format, ...); -void LogException(std::exception* pex, const char* pszThread); void PrintException(std::exception* pex, const char* pszThread); void PrintExceptionContinue(std::exception* pex, const char* pszThread); -void ParseString(const std::string& str, char c, std::vector& v); std::string FormatMoney(int64 n, bool fPlus=false); bool ParseMoney(const std::string& str, int64& nRet); bool ParseMoney(const char* pszIn, int64& nRet); diff -uNr a/bitcoin/src/wallet.cpp b/bitcoin/src/wallet.cpp --- a/bitcoin/src/wallet.cpp bdc4fc472be4a86fb91fa69368faace04414fdeee5b8c82795e31d37e21581b973caf7f3e9ccc27d487944a5782e3b59615180eab87c8b3e81242901f3039e4d +++ b/bitcoin/src/wallet.cpp 26a4240a574885aed57e4019ebfd397f3b42b5616c9260a49d310b5fbf977e31c2fc506e3dc23fd9e394f4ef989020d11c39c25924a201dedebcd00f072b95f5 @@ -368,45 +368,6 @@ return nTimeReceived; } -int CWalletTx::GetRequestCount() const -{ - // Returns -1 if it wasn't being tracked - int nRequests = -1; - CRITICAL_BLOCK(pwallet->cs_wallet) - { - if (IsCoinBase()) - { - // Generated block - if (hashBlock != 0) - { - map::const_iterator mi = pwallet->mapRequestCount.find(hashBlock); - if (mi != pwallet->mapRequestCount.end()) - nRequests = (*mi).second; - } - } - else - { - // Did anyone request this transaction? - map::const_iterator mi = pwallet->mapRequestCount.find(GetHash()); - if (mi != pwallet->mapRequestCount.end()) - { - nRequests = (*mi).second; - - // How about the block it's in? - if (nRequests == 0 && hashBlock != 0) - { - map::const_iterator mi = pwallet->mapRequestCount.find(hashBlock); - if (mi != pwallet->mapRequestCount.end()) - nRequests = (*mi).second; - else - nRequests = 1; // If it's in someone else's block it must have got out - } - } - } - } - return nRequests; -} - void CWalletTx::GetAmounts(int64& nGeneratedImmature, int64& nGeneratedMature, list >& listReceived, list >& listSent, int64& nFee, string& strSentAccount) const { @@ -739,22 +700,6 @@ return nTotal; } -int64 CWallet::GetUnconfirmedBalance() const -{ - int64 nTotal = 0; - CRITICAL_BLOCK(cs_wallet) - { - for (map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) - { - const CWalletTx* pcoin = &(*it).second; - if (pcoin->IsFinal() && pcoin->IsConfirmed()) - continue; - nTotal += pcoin->GetAvailableCredit(); - } - } - return nTotal; -} - bool CWallet::SelectCoinsMinConf(int64 nTargetValue, int nConfMine, int nConfTheirs, set >& setCoinsRet, int64& nValueRet) const { setCoinsRet.clear(); @@ -1189,15 +1134,6 @@ return CWalletDB(strWalletFile).WriteName(address.ToString(), strName); } -bool CWallet::DelAddressBookName(const CBitcoinAddress& address) -{ - mapAddressBook.erase(address); - if (!fFileBacked) - return false; - return CWalletDB(strWalletFile).EraseName(address.ToString()); -} - - void CWallet::PrintWallet(const CBlock& block) { CRITICAL_BLOCK(cs_wallet) diff -uNr a/bitcoin/src/wallet.h b/bitcoin/src/wallet.h --- a/bitcoin/src/wallet.h 86f5e1ca584e6aa01b956278ea06eff4f79b58ca386c490fe605384923f90fcc710fd6bf2f14926d5dfd43e17fc5655a0150b32bc750f05506baf439255c8e30 +++ b/bitcoin/src/wallet.h 979cd9be82d7740508236fb6f1f986637fc9e7477f7df123d1a19d48a6fa249ff30e503da0fee49dc8bc87e93661c8220efd84df6084535d7246bb71340fcbbe @@ -82,7 +82,6 @@ void ReacceptWalletTransactions(); void ResendWalletTransactions(); int64 GetBalance() const; - int64 GetUnconfirmedBalance() const; bool CreateTransaction(const std::vector >& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet); bool CreateTransaction(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet); bool CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey); @@ -179,8 +178,6 @@ bool SetAddressBookName(const CBitcoinAddress& address, const std::string& strName); - bool DelAddressBookName(const CBitcoinAddress& address); - void UpdatedTransaction(const uint256 &hashTx) { CRITICAL_BLOCK(cs_wallet) @@ -525,7 +522,6 @@ bool WriteToDisk(); int64 GetTxTime() const; - int GetRequestCount() const; void AddSupportingTransactions(CTxDB& txdb);