diff --git a/lib/bitcoin.py b/lib/bitcoin.py index df3fdf02af10..5c89e8b721aa 100644 --- a/lib/bitcoin.py +++ b/lib/bitcoin.py @@ -86,7 +86,8 @@ def set_mainnet(cls): cls.CHECKPOINTS = read_json('checkpoints.json', []) cls.EQUIHASH_N = 200 cls.EQUIHASH_K = 9 - #cls.HEADERS_URL = "http://headers.zcl-electrum.com/blockchain_headers" + + cls.HEADERS_URL = "https://headers.btcprivate.org/blockchain_headers" cls.CHUNK_SIZE = 200 diff --git a/lib/currencies.json b/lib/currencies.json index 7d241d846bab..725f260bd73f 100644 --- a/lib/currencies.json +++ b/lib/currencies.json @@ -1,5 +1,5 @@ { - "CryptoCompare": [ + "CoinMarketCap": [ "USD", "EUR", "CNY" diff --git a/lib/exchange_rate.py b/lib/exchange_rate.py index 50e939afd492..74d33914d9de 100644 --- a/lib/exchange_rate.py +++ b/lib/exchange_rate.py @@ -88,12 +88,11 @@ def get_currencies(self): return sorted([str(a) for (a, b) in rates.items() if b is not None and len(a) in [3,4]]) -class CryptoCompare(ExchangeBase): +class CoinMarketCap(ExchangeBase): def get_rates(self, ccy): - json = self.get_json('min-api.cryptocompare.com', - "/data/pricehistorical?fsym=BTCP&tsyms=USD") - return {'USD': Decimal(json['BTCP']['USD'])} - + json = self.get_json('api.coinmarketcap.com', + "/v1/ticker/btcprivate?convert=%s") + return {'USD': Decimal(json[0]['price_usd'])} def dictinvert(d): @@ -199,7 +198,7 @@ def get_currency(self): return self.config.get('currency', 'USD') def config_exchange(self): - return self.config.get('use_exchange', 'CryptoCompare') + return self.config.get('use_exchange', 'CoinMarketCap') def show_history(self): return self.is_enabled() and self.get_history_config() and self.ccy in self.exchange.history_ccys() @@ -211,7 +210,7 @@ def set_currency(self, ccy): self.on_quotes() def set_exchange(self, name): - class_ = globals().get(name, CryptoCompare) + class_ = globals().get(name, CoinMarketCap) self.print_error("using exchange", name) if self.config_exchange() != name: self.config.set_key('use_exchange', name, True) diff --git a/lib/servers.json b/lib/servers.json index 3e578c8bfb75..cbc434341680 100644 --- a/lib/servers.json +++ b/lib/servers.json @@ -1,4 +1,4 @@ { - "35.231.30.135": {"s":"50002"} + "electrum.btcprivate.org": {"s":"5222"} } diff --git a/lib/util.py b/lib/util.py index 2757b52951b1..414bc9fe0a20 100644 --- a/lib/util.py +++ b/lib/util.py @@ -432,20 +432,15 @@ def time_difference(distance_in_time, include_seconds): # For raw json, append /insight-api-zcash mainnet_block_explorers = { - 'ZclassicExplorer.com': ('http://zclassicexplorer.com', - {'tx': 'tx', 'addr': 'address'}), - 'ZCLMine.pro': ('http://explorer.zclmine.pro', - {'tx': 'tx', 'addr': 'address'}), - 'MyZCL.com': ('http://myzcl.com', + 'explorer.btcprivate.org': ('https://explorer.btcprivate.org', {'tx': 'tx', 'addr': 'address'}), 'system default': ('blockchain:', {'tx': 'tx', 'addr': 'address'}) } -# TODO btcp testnet block explorer testnet_block_explorers = { - #'Blocktrail.com': ('https://www.blocktrail.com/tBTC', - #{'tx': 'tx', 'addr': 'address'}), + #'testnet.btcprivate.org': ('https://testnet.btcprivate.org', + # {'tx': 'tx', 'addr': 'address'}), 'system default': ('blockchain:', {'tx': 'tx', 'addr': 'address'}) } @@ -455,7 +450,7 @@ def block_explorer_info(): return testnet_block_explorers if bitcoin.NetworkConstants.TESTNET else mainnet_block_explorers def block_explorer(config): - return config.get('block_explorer', 'explorer.zclassic.org/insight/') + return config.get('block_explorer', 'explorer.btcprivate.org') def block_explorer_tuple(config): return block_explorer_info().get(block_explorer(config))