fix: do not request the same history twice
authorThomasV <thomasv@gitorious>
Fri, 14 Dec 2012 18:32:10 +0000 (19:32 +0100)
committerThomasV <thomasv@gitorious>
Fri, 14 Dec 2012 18:32:10 +0000 (19:32 +0100)
lib/wallet.py

index 9143d52..0953b03 100644 (file)
@@ -1252,8 +1252,9 @@ class WalletSynchronizer(threading.Thread):
             if method == 'blockchain.address.subscribe':
                 addr = params[0]
                 if self.wallet.get_status(self.wallet.get_history(addr)) != result:
-                    self.interface.send([('blockchain.address.get_history', [addr])], 'synchronizer')
-                    requested_histories[addr] = result
+                    if requested_histories.get(addr) is None:
+                        self.interface.send([('blockchain.address.get_history', [addr])], 'synchronizer')
+                        requested_histories[addr] = result
 
             elif method == 'blockchain.address.get_history':
                 addr = params[0]