tverify: return earlier if request is empty - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit d85a11173d00a653c535ee0e4e34068676d49352 DIR parent cbeeedcca23e957e9e586c5787d85dfba50592f1 HTML Author: ThomasV <thomasv@gitorious> Date: Wed, 3 Jun 2015 09:34:35 +0200 verify: return earlier if request is empty Diffstat: M lib/paymentrequest.py | 4 ++++ 1 file changed, 4 insertions(+), 0 deletions(-) --- DIR diff --git a/lib/paymentrequest.py b/lib/paymentrequest.py t@@ -64,6 +64,7 @@ def get_payment_request(url): connection.request("GET", u.geturl(), headers=REQUEST_HEADERS) response = connection.getresponse() data = response.read() + print_error('fetched payment request', url, len(data)) elif u.scheme == 'file': with open(u.path, 'r') as f: data = f.read() t@@ -105,6 +106,9 @@ class PaymentRequest: if not ca_list: self.error = "Trusted certificate authorities list not found" return False + if not self.raw: + self.error = "Empty request" + return paymntreq = pb2.PaymentRequest() paymntreq.ParseFromString(self.raw) if not paymntreq.signature: