From 508b5373ac009f9d7cde29a8c2c493ab0524dd1f Mon Sep 17 00:00:00 2001 From: ThomasV Date: Wed, 22 Jul 2015 15:33:50 +0200 Subject: [PATCH] minor fixes --- gui/qt/main_window.py | 2 +- lib/paymentrequest.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index ad545377f..c447f7b81 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -685,7 +685,7 @@ class ElectrumWindow(QMainWindow): return addr = str(item.text(2)) req = self.wallet.receive_requests[addr] - expires = _('Never') if req.get('exp') is None else util.age(req['time'] + req['exp']) + expires = util.age(req['time'] + req['exp']) if req.get('exp') else _('Never') amount = req['amount'] message = self.wallet.labels.get(addr, '') self.receive_address_e.setText(addr) diff --git a/lib/paymentrequest.py b/lib/paymentrequest.py index c05649d2f..e35712733 100644 --- a/lib/paymentrequest.py +++ b/lib/paymentrequest.py @@ -291,7 +291,7 @@ def make_unsigned_request(req): from transaction import Transaction addr = req['address'] time = req.get('time', 0) - expires = req.get('exp', 0) + exp = req.get('exp', 0) if time and type(time) != int: time = 0 if exp and type(exp) != int: @@ -306,7 +306,7 @@ def make_unsigned_request(req): for script, amount in outputs: pd.outputs.add(amount=amount, script=script) pd.time = time - pd.expires = time + expires if expires else 0 + pd.expires = time + exp if exp else 0 pd.memo = memo pr = pb2.PaymentRequest() pr.serialized_payment_details = pd.SerializeToString()