tfix #4098 - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit c3e26a1e2b8b579c64f765d02e015df65e82934c DIR parent 152ec1447ced1a33a372d1684caa8be2ae1755c2 HTML Author: ThomasV <thomasv@electrum.org> Date: Mon, 12 Mar 2018 12:19:45 +0100 fix #4098 Diffstat: M lib/wallet.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) --- DIR diff --git a/lib/wallet.py b/lib/wallet.py t@@ -1628,13 +1628,14 @@ class Abstract_Wallet(PrintError): return True def get_sorted_requests(self, config): - def f(x): + def f(addr): try: - addr = x.get('address') - return self.get_address_index(addr) or addr + return self.get_address_index(addr) except: - return addr - return sorted(map(lambda x: self.get_payment_request(x, config), self.receive_requests.keys()), key=f) + return + keys = map(lambda x: (f(x), x), self.receive_requests.keys()) + sorted_keys = sorted(filter(lambda x: x[0] is not None, keys)) + return [self.get_payment_request(x[1], config) for x in sorted_keys] def get_fingerprint(self): raise NotImplementedError()