Fix broken ExtractAddress (refactored, made callers check for addresses in keystore if they care)

This commit is contained in:
Gavin Andresen
2011-12-22 15:51:44 -05:00
parent ce336fdc21
commit 2e17ac83c6
7 changed files with 20 additions and 18 deletions

View File

@@ -80,7 +80,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
if(wallet->IsMine(txout))
{
CBitcoinAddress address;
if (ExtractAddress(txout.scriptPubKey, wallet, address))
if (ExtractAddress(txout.scriptPubKey, address) && wallet->HaveKey(address))
{
sub.address = address.ToString();
}
@@ -138,7 +138,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
// Sent to Bitcoin Address
sub.type = TransactionRecord::SendToAddress;
CBitcoinAddress address;
if (ExtractAddress(txout.scriptPubKey, 0, address))
if (ExtractAddress(txout.scriptPubKey, address))
{
sub.address = address.ToString();
}