Skip to content

Commit

Permalink
Merge pull request spesmilo#2850 from wakiyamap/fix_download_bcheaders
Browse files Browse the repository at this point in the history
Fix download failed blockchain headers
  • Loading branch information
ecdsa authored Sep 10, 2017
2 parents 70af22c + 0791b46 commit afa1a4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -982,10 +982,10 @@ def init_headers_file(self):
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:
Expand Down

0 comments on commit afa1a4d

Please sign in to comment.