From 0791b469e79e449ded79640f91d71bae786102b9 Mon Sep 17 00:00:00 2001 From: WakiyamaP Date: Fri, 8 Sep 2017 10:57:22 +0900 Subject: [PATCH 1/2] fix download failed blockchain headers --- lib/network.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/network.py b/lib/network.py index cd038800..b98b2041 100644 --- a/lib/network.py +++ b/lib/network.py @@ -982,10 +982,10 @@ class Network(util.DaemonThread): filename = b.path() def download_thread(): try: - import urllib, socket + import urllib.request, socket socket.setdefaulttimeout(30) self.print_error("downloading ", bitcoin.HEADERS_URL) - urllib.urlretrieve(bitcoin.HEADERS_URL, filename + '.tmp') + urllib.request.urlretrieve(bitcoin.HEADERS_URL, filename + '.tmp') os.rename(filename + '.tmp', filename) self.print_error("done.") except Exception: From c50a460395ee1d59fe1cd8a7fa3a99b85437e763 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Sun, 10 Sep 2017 16:28:06 +0200 Subject: [PATCH 2/2] fixes #2858 --- lib/transaction.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/transaction.py b/lib/transaction.py index fc3ac627..39a45a37 100644 --- a/lib/transaction.py +++ b/lib/transaction.py @@ -591,6 +591,8 @@ class Transaction: return addr elif output_type == TYPE_ADDRESS: return bitcoin.address_to_script(addr) + elif output_type == TYPE_PUBKEY: + return addr else: raise TypeError('Unknown output type') return script