fix download failed blockchain headers

This commit is contained in:
WakiyamaP 2017-09-08 10:57:22 +09:00
parent 70af22c9e4
commit 0791b469e7
1 changed files with 2 additions and 2 deletions

View File

@ -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: