electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 4d41c36cbb3df15c2bb2f333b0275479eaa818fc
parent b4d5934da000879a4bb137957e1be55a4a99a044
Author: ThomasV <thomasv@electrum.org>
Date:   Sat,  7 Jan 2017 18:39:41 +0100

add headers url for testnet

Diffstat:
Mlib/bitcoin.py | 2++
Mlib/blockchain.py | 6++----
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/bitcoin.py b/lib/bitcoin.py @@ -42,6 +42,7 @@ ADDRTYPE_P2PKH = 0 ADDRTYPE_P2SH = 5 XPRV_HEADER = "0488ade4" XPUB_HEADER = "0488b21e" +HEADERS_URL = "https://headers.electrum.org/blockchain_headers" def set_testnet(): global ADDRTYPE_P2PKH, ADDRTYPE_P2SH @@ -52,6 +53,7 @@ def set_testnet(): ADDRTYPE_P2SH = 196 XPRV_HEADER = "04358394" XPUB_HEADER = "043587cf" + HEADERS_URL = "https://headers.electrum.org/testnet_headers" ################################## transactions diff --git a/lib/blockchain.py b/lib/blockchain.py @@ -37,7 +37,6 @@ class Blockchain(util.PrintError): def __init__(self, config, network): self.config = config self.network = network - self.headers_url = "https://headers.electrum.org/blockchain_headers" self.local_height = 0 self.set_local_height() @@ -111,11 +110,10 @@ class Blockchain(util.PrintError): if os.path.exists(filename): return try: - if bitcoin.TESTNET: raise import urllib, socket socket.setdefaulttimeout(30) - self.print_error("downloading ", self.headers_url) - urllib.urlretrieve(self.headers_url, filename + '.tmp') + self.print_error("downloading ", bitcoin.HEADERS_URL) + urllib.urlretrieve(bitcoin.HEADERS_URL, filename + '.tmp') os.rename(filename + '.tmp', filename) self.print_error("done.") except Exception: