From 2e17ac83c65b65fe2037b8c8941c25e288905903 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Thu, 22 Dec 2011 15:51:44 -0500 Subject: Fix broken ExtractAddress (refactored, made callers check for addresses in keystore if they care) --- src/wallet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/wallet.cpp') diff --git a/src/wallet.cpp b/src/wallet.cpp index c35081ce44..28d15ef2e5 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -394,7 +394,7 @@ bool CWallet::IsChange(const CTxOut& txout) const // a better way of identifying which outputs are 'the send' and which are // 'the change' will need to be implemented (maybe extend CWalletTx to remember // which output, if any, was change). - if (ExtractAddress(txout.scriptPubKey, this, address)) + if (ExtractAddress(txout.scriptPubKey, address) && HaveKey(address)) CRITICAL_BLOCK(cs_wallet) if (!mapAddressBook.count(address)) return true; @@ -475,7 +475,7 @@ void CWalletTx::GetAmounts(int64& nGeneratedImmature, int64& nGeneratedMature, l { CBitcoinAddress address; vector vchPubKey; - if (!ExtractAddress(txout.scriptPubKey, NULL, address)) + if (!ExtractAddress(txout.scriptPubKey, address)) { printf("CWalletTx::GetAmounts: Unknown transaction type found, txid %s\n", this->GetHash().ToString().c_str()); -- cgit v1.2.3