Browse Source

Merge branch 'master' of gitorious.org:electrum/electrum

283
ThomasV 13 years ago
parent
commit
7aada899e7
  1. 7
      client/electrum.py
  2. 9
      client/gui.py

7
client/electrum.py

@ -404,6 +404,7 @@ class Wallet:
def get_addr_balance(self, addr): def get_addr_balance(self, addr):
h = self.history.get(addr) h = self.history.get(addr)
if not h: return 0,0
c = u = 0 c = u = 0
for item in h: for item in h:
v = item['value'] v = item['value']
@ -474,7 +475,7 @@ class Wallet:
if blocks == -1: raise BaseException("session not found") if blocks == -1: raise BaseException("session not found")
self.blocks = int(blocks) self.blocks = int(blocks)
for addr, blk_hash in changed_addresses.items(): for addr, blk_hash in changed_addresses.items():
if self.status[addr] != blk_hash: if self.status.get(addr) != blk_hash:
print "updating history for", addr print "updating history for", addr
self.history[addr] = self.retrieve_history(addr) self.history[addr] = self.retrieve_history(addr)
self.status[addr] = blk_hash self.status[addr] = blk_hash
@ -568,7 +569,9 @@ class Wallet:
def update_tx_history(self): def update_tx_history(self):
self.tx_history= {} self.tx_history= {}
for addr in self.addresses: for addr in self.addresses:
for tx in self.history[addr]: h = self.history.get(addr)
if h is None: continue
for tx in h:
tx_hash = tx['tx_hash'] tx_hash = tx['tx_hash']
line = self.tx_history.get(tx_hash) line = self.tx_history.get(tx_hash)
if not line: if not line:

9
client/gui.py

@ -1024,9 +1024,12 @@ class BitcoinGUI:
show_message("error") show_message("error")
return return
wallet.host = host if host!= wallet.host or port!=wallet.port:
wallet.port = port wallet.host = host
wallet.save() wallet.port = port
wallet.save()
self.is_connected = False
wallet.new_session()
def main(self): def main(self):

Loading…
Cancel
Save