List Accounts Fix (Issue 76)
Addresses from the sending tab in wxGUI's addressbook appear in listaccounts. The RPC will happily return that address even though it isn't yours.
This is a problem when switching from wxGUI to a RPC UI.
Fixed by adding
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;
to make sure that mapAccountBalances doesn't contain any addresses that we don't have in our key list.
My previous request didn't build. whoops Fixed for sure this time.