From a7440fc89cc0174f403e27659f3328ce3c690061 Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Tue, 31 Mar 2015 09:24:36 +0300 Subject: [PATCH 1/3] wallet: skip history sort when verifier is not set --- lib/wallet.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/wallet.py b/lib/wallet.py index 7646a15b5..325d92e70 100644 --- a/lib/wallet.py +++ b/lib/wallet.py @@ -748,7 +748,8 @@ class Abstract_Wallet(object): #balance += value conf, timestamp = self.verifier.get_confirmations(tx_hash) if self.verifier else (None, None) history.append( (tx_hash, conf, value, timestamp) ) - history.sort(key = lambda x: self.verifier.get_txpos(x[0])) + if self.verifier: + history.sort(key = lambda x: self.verifier.get_txpos(x[0])) c, u = self.get_balance(domain) balance = c + u From 43a4b68ee83ff26aa26530ab8f0081669f5f5a5b Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Tue, 31 Mar 2015 09:33:14 +0300 Subject: [PATCH 2/3] main_window: don't update history in offline mode --- gui/qt/main_window.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 9429f3b2c..ddbd2f7f8 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -689,6 +689,9 @@ class ElectrumWindow(QMainWindow): for item in self.wallet.get_history(self.current_account): tx_hash, conf, value, timestamp, balance = item time_str = _("unknown") + if conf is None and timestamp is None: + continue # skip history in offline mode + if conf > 0: time_str = self.format_time(timestamp) if conf == -1: From c5d45da9333260c498a4fd72efe3bcf2a4aba2f8 Mon Sep 17 00:00:00 2001 From: Riccardo Spagni Date: Tue, 31 Mar 2015 18:02:59 +0200 Subject: [PATCH 3/3] tweaked resolve and DNSSEC timeouts to be less aggressive --- plugins/openalias.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/openalias.py b/plugins/openalias.py index d9e5612a4..4e50bbe57 100644 --- a/plugins/openalias.py +++ b/plugins/openalias.py @@ -185,7 +185,7 @@ class Plugin(BasePlugin): try: resolver = dns.resolver.Resolver() resolver.timeout = 2.0 - resolver.lifetime = 2.0 + resolver.lifetime = 4.0 records = resolver.query(url, dns.rdatatype.TXT) for record in records: string = record.strings[0] @@ -232,7 +232,7 @@ class Plugin(BasePlugin): for i in xrange(len(parts), 0, -1): sub = '.'.join(parts[i - 1:]) query = dns.message.make_query(sub, dns.rdatatype.NS) - response = dns.query.udp(query, ns, 1) + response = dns.query.udp(query, ns, 3) if response.rcode() != dns.rcode.NOERROR: self.print_error("query error") return 0 @@ -250,7 +250,7 @@ class Plugin(BasePlugin): query = dns.message.make_query(sub, dns.rdatatype.DNSKEY, want_dnssec=True) - response = dns.query.udp(query, ns, 1) + response = dns.query.udp(query, ns, 3) if response.rcode() != 0: self.print_error("query error") return 0