Browse Source

wallet.py: fix balance/history for duplicate addresses

in a hd wallet, having duplicate addresses is extremely unlikely, but if it happened, previously an incorrect balance was calculated
3.2.x
SomberNight 7 years ago
parent
commit
ad7f8f2cbe
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 3
      lib/wallet.py

3
lib/wallet.py

@ -714,6 +714,7 @@ class Abstract_Wallet(PrintError):
coins = []
if domain is None:
domain = self.get_addresses()
domain = set(domain)
if exclude_frozen:
domain = set(domain) - self.frozen_addresses
for addr in domain:
@ -742,6 +743,7 @@ class Abstract_Wallet(PrintError):
def get_balance(self, domain=None):
if domain is None:
domain = self.get_addresses()
domain = set(domain)
cc = uu = xx = 0
for addr in domain:
c, u, x = self.get_addr_balance(addr)
@ -990,6 +992,7 @@ class Abstract_Wallet(PrintError):
# get domain
if domain is None:
domain = self.get_addresses()
domain = set(domain)
# 1. Get the history of each address in the domain, maintain the
# delta of a tx as the sum of its deltas on domain addresses
tx_deltas = defaultdict(int)

Loading…
Cancel
Save