electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 64cf87f91135ff07a619ec18d79cbeb277e1034c
parent 936db23d3c7178fb550947bce727638932aa26b1
Author: ThomasV <thomasv@gitorious>
Date:   Thu, 12 Jan 2012 15:39:09 +0300

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

Diffstat:
Mclient/electrum.py | 11++++++-----
Mclient/gui.py | 14+++++++-------
2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/client/electrum.py b/client/electrum.py @@ -253,6 +253,7 @@ class Interface: def send_tx(self, data): if self.use_http(): out = self.http_json_server.blockchain.transaction.broadcast(data) + out = out.get("result") else: out = self.request( repr ( ('tx', data ))) return out @@ -282,11 +283,11 @@ class Interface: out = ast.literal_eval( self.request( repr ( ('new_session', repr( ( version, addresses)) )))) self.session_id, self.message = out - def update_session(self): + def update_session(self, addresses): if self.use_http(): - out = self.http_json_server.session.update(self.session_id, self.all_addresses()) + out = self.http_json_server.session.update(self.session_id, addresses) else: - out = self.request( repr ( ('update_session', repr((self.session_id, self.all_addresses()))))) + out = self.request( repr ( ('update_session', repr((self.session_id, addresses))))) return out def get_servers(self): @@ -490,7 +491,7 @@ class Wallet: 'fee':self.fee, 'host':self.interface.host, 'port':self.interface.port, - 'blocks':self.blocks, + 'blocks':self.interface.blocks, 'seed':self.seed, 'addresses':self.addresses, 'change_addresses':self.change_addresses, @@ -520,7 +521,7 @@ class Wallet: self.fee = int( d.get('fee') ) self.interface.host = d.get('host') self.interface.set_port( d.get('port') ) - self.blocks = d.get('blocks') + self.interface.blocks = d.get('blocks') self.seed = d.get('seed') self.addresses = d.get('addresses') self.change_addresses = d.get('change_addresses') diff --git a/client/gui.py b/client/gui.py @@ -276,7 +276,7 @@ def run_settings_dialog(wallet, is_create, is_recovery, parent): if is_create: wallet.interface.host = host - wallet.interface.port = port + wallet.interface.set_port( port ) if is_recovery: wallet.seed = seed wallet.gap_limit = gap @@ -507,7 +507,7 @@ class BitcoinGUI: while True: try: if self.is_connected and self.update_session: - self.wallet.interface.update_session() + self.wallet.interface.update_session( self.wallet.all_addresses() ) self.update_session = False if time.time() - get_servers_time > 5*60: @@ -516,7 +516,7 @@ class BitcoinGUI: self.period = 15 if self.wallet.interface.use_http() else 5 if self.wallet.update(): - self.wallet.interface.update_session() + self.wallet.interface.update_session( self.wallet.all_addresses() ) gobject.idle_add( self.update_history_tab ) gobject.idle_add( self.update_receiving_tab ) # addressbook too... @@ -910,10 +910,10 @@ class BitcoinGUI: c, u = self.wallet.get_balance() if self.is_connected: self.status_image.set_from_stock(gtk.STOCK_YES, gtk.ICON_SIZE_MENU) - self.network_button.set_tooltip_text("Connected to %s.\n%d blocks\nresponse time: %f"%(self.wallet.interface.host, self.wallet.blocks, self.wallet.interface.rtime)) + self.network_button.set_tooltip_text("Connected to %s.\n%d blocks\nresponse time: %f"%(self.wallet.interface.host, self.wallet.interface.blocks, self.wallet.interface.rtime)) else: self.status_image.set_from_stock(gtk.STOCK_NO, gtk.ICON_SIZE_MENU) - self.network_button.set_tooltip_text("Trying to contact %s.\n%d blocks"%(self.wallet.interface.host, self.wallet.blocks)) + self.network_button.set_tooltip_text("Trying to contact %s.\n%d blocks"%(self.wallet.interface.host, self.wallet.interface.blocks)) text = "Balance: %s "%( format_satoshis(c) ) if u: text += "[+ %s unconfirmed]"%( format_satoshis(u) ) if self.error: text = self.error @@ -950,7 +950,7 @@ class BitcoinGUI: for tx in self.wallet.get_tx_history(): tx_hash = tx['tx_hash'] if tx['height']: - conf = self.wallet.blocks - tx['height'] + 1 + conf = self.wallet.interface.blocks - tx['height'] + 1 time_str = datetime.datetime.fromtimestamp( tx['nTime']).isoformat(' ')[:-3] conf_icon = gtk.STOCK_APPLY else: @@ -1035,7 +1035,7 @@ class BitcoinGUI: image = gtk.Image() image.set_from_stock(gtk.STOCK_NETWORK, gtk.ICON_SIZE_DIALOG) if self.is_connected: - status = "Connected to %s.\n%d blocks\nresponse time: %f"%(wallet.interface.host, wallet.blocks, wallet.interface.rtime) + status = "Connected to %s.\n%d blocks\nresponse time: %f"%(wallet.interface.host, wallet.interface.blocks, wallet.interface.rtime) else: status = "Not connected"