Merge pull request #2850 from wakiyamap/fix_download_bcheaders

Fix download failed blockchain headers
This commit is contained in:
ThomasV 2017-09-10 12:36:03 +02:00 committed by GitHub
commit afa1a4d22a
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: