From 0a4cb8697645b61f781421aa10cf3f7841f776e5 Mon Sep 17 00:00:00 2001 From: Eric Swanson Date: Sun, 20 Mar 2011 18:32:39 -0400 Subject: [PATCH] Fixed issue 76 -- RPC error where addresses from addressbook's sending tab appear in listaccounts --- rpc.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rpc.cpp b/rpc.cpp index 6041de056..a7b3b80d9 100644 --- a/rpc.cpp +++ b/rpc.cpp @@ -1150,8 +1150,11 @@ Value listaccounts(const Array& params, bool fHelp) CRITICAL_BLOCK(cs_mapWallet) CRITICAL_BLOCK(cs_mapAddressBook) { - foreach(const PAIRTYPE(string, string)& entry, mapAddressBook) - mapAccountBalances[entry.second] = 0; + foreach(const PAIRTYPE(string, string)& entry, mapAddressBook) { + uint160 hash160; + if(AddressToHash160(entry.first, hash160) && mapPubKeys.count(hash160)) // This address belongs to me + mapAccountBalances[entry.second] = 0; + } for (map::iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) {