From 8d0041e607a0e5bff52152f3d8af504f3703baa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Barbosa?= Date: Wed, 6 Sep 2017 23:47:53 +0100 Subject: [PATCH 1/2] Remove unused GetKeyID and IsScript methods from CBitcoinAddress --- src/base58.cpp | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/base58.cpp b/src/base58.cpp index e093608aa..3b907c20d 100644 --- a/src/base58.cpp +++ b/src/base58.cpp @@ -232,8 +232,6 @@ public: CBitcoinAddress(const char* pszAddress) { SetString(pszAddress); } CTxDestination Get() const; - bool GetKeyID(CKeyID &keyID) const; - bool IsScript() const; }; class CBitcoinAddressVisitor : public boost::static_visitor @@ -295,21 +293,6 @@ CTxDestination CBitcoinAddress::Get() const return CNoDestination(); } -bool CBitcoinAddress::GetKeyID(CKeyID& keyID) const -{ - if (!IsValid() || vchVersion != Params().Base58Prefix(CChainParams::PUBKEY_ADDRESS)) - return false; - uint160 id; - memcpy(&id, vchData.data(), 20); - keyID = CKeyID(id); - return true; -} - -bool CBitcoinAddress::IsScript() const -{ - return IsValid() && vchVersion == Params().Base58Prefix(CChainParams::SCRIPT_ADDRESS); -} - void CBitcoinSecret::SetKey(const CKey& vchSecret) { assert(vchSecret.IsValid()); From 86e6dd4b630299eaa778ca241797b24758b6f8a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Barbosa?= Date: Wed, 6 Sep 2017 21:44:33 +0100 Subject: [PATCH 2/2] Remove duplicate destination decoding --- src/qt/transactiondesc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index f3fe4096a..74f5c774a 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -91,8 +91,8 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco if (nNet > 0) { // Credit - if (IsValidDestinationString(rec->address)) { - CTxDestination address = DecodeDestination(rec->address); + CTxDestination address = DecodeDestination(rec->address); + if (IsValidDestination(address)) { if (wallet->mapAddressBook.count(address)) { strHTML += "" + tr("From") + ": " + tr("unknown") + "
";