Fixing exchanges and block explorer for FLO
This commit is contained in:
parent
c0daef2657
commit
1e6edd0abc
@ -182,7 +182,7 @@ class Blockchain(util.PrintError):
|
||||
raise Exception("prev hash mismatch: %s vs %s" % (prev_hash, header.get('prev_block_hash')))
|
||||
if constants.net.TESTNET:
|
||||
return
|
||||
print("I'm inside verify_header")
|
||||
#print("I'm inside verify_header")
|
||||
#bits = self.target_to_bits(target)
|
||||
bits = target
|
||||
if bits != header.get('bits'):
|
||||
@ -191,18 +191,19 @@ class Blockchain(util.PrintError):
|
||||
target_val = self.bits_to_target(bits)
|
||||
if int('0x' + _powhash, 16) > target_val:
|
||||
raise Exception("insufficient proof of work: %s vs target %s" % (int('0x' + _hash, 16), target_val))
|
||||
print("I passed verify_header(). Calc target values have been matched")
|
||||
#print("I passed verify_header(). Calc target values have been matched")
|
||||
|
||||
def verify_chunk(self, index, data):
|
||||
num = len(data) // 80
|
||||
current_header = (index * 2016)
|
||||
# last = (index * 2016 + 2015)
|
||||
print(index*2016)
|
||||
prev_hash = self.get_hash(current_header - 1)
|
||||
for i in range(num):
|
||||
target = self.get_target(current_header - 1)
|
||||
raw_header = data[i*80:(i+1) * 80]
|
||||
header = deserialize_header(raw_header, current_header)
|
||||
print(i)
|
||||
#print(i)
|
||||
self.verify_header(header, prev_hash, target)
|
||||
self.save_chunk_part(header)
|
||||
prev_hash = hash_header(header)
|
||||
|
||||
@ -357,7 +357,7 @@
|
||||
"Bitvalor": [
|
||||
"BRL"
|
||||
],
|
||||
"BlockchainInfo": [
|
||||
"Bittrex": [
|
||||
"AUD",
|
||||
"BRL",
|
||||
"CAD",
|
||||
|
||||
@ -208,11 +208,13 @@ class Bitvalor(ExchangeBase):
|
||||
return {'BRL': Decimal(json['ticker_1h']['total']['last'])}
|
||||
|
||||
|
||||
class BlockchainInfo(ExchangeBase):
|
||||
class Bittrex(ExchangeBase):
|
||||
|
||||
def get_rates(self, ccy):
|
||||
json = self.get_json('bittrex.com','/api/v1.1/public/getticker?market=BTC-FLO')
|
||||
floPrice_inBTC = json['result']['Last']
|
||||
json = self.get_json('blockchain.info', '/ticker')
|
||||
return dict([(r, Decimal(json[r]['15m'])) for r in json])
|
||||
return dict([(r, Decimal(json[r]['15m'] * floPrice_inBTC)) for r in json])
|
||||
|
||||
|
||||
class BTCChina(ExchangeBase):
|
||||
|
||||
@ -584,43 +584,17 @@ def time_difference(distance_in_time, include_seconds):
|
||||
return "over %d years" % (round(distance_in_minutes / 525600))
|
||||
|
||||
mainnet_block_explorers = {
|
||||
'Biteasy.com': ('https://www.biteasy.com/blockchain/',
|
||||
{'tx': 'transactions/', 'addr': 'addresses/'}),
|
||||
'Bitflyer.jp': ('https://chainflyer.bitflyer.jp/',
|
||||
{'tx': 'Transaction/', 'addr': 'Address/'}),
|
||||
'Blockchain.info': ('https://blockchain.info/',
|
||||
{'tx': 'tx/', 'addr': 'address/'}),
|
||||
'blockchainbdgpzk.onion': ('https://blockchainbdgpzk.onion/',
|
||||
{'tx': 'tx/', 'addr': 'address/'}),
|
||||
'Blockr.io': ('https://btc.blockr.io/',
|
||||
{'tx': 'tx/info/', 'addr': 'address/info/'}),
|
||||
'Blocktrail.com': ('https://www.blocktrail.com/BTC/',
|
||||
{'tx': 'tx/', 'addr': 'address/'}),
|
||||
'BTC.com': ('https://chain.btc.com/',
|
||||
{'tx': 'tx/', 'addr': 'address/'}),
|
||||
'Chain.so': ('https://www.chain.so/',
|
||||
{'tx': 'tx/BTC/', 'addr': 'address/BTC/'}),
|
||||
'Insight.is': ('https://insight.bitpay.com/',
|
||||
{'tx': 'tx/', 'addr': 'address/'}),
|
||||
'TradeBlock.com': ('https://tradeblock.com/blockchain/',
|
||||
{'tx': 'tx/', 'addr': 'address/'}),
|
||||
'BlockCypher.com': ('https://live.blockcypher.com/btc/',
|
||||
{'tx': 'tx/', 'addr': 'address/'}),
|
||||
'Blockchair.com': ('https://blockchair.com/bitcoin/',
|
||||
{'tx': 'transaction/', 'addr': 'address/'}),
|
||||
'blockonomics.co': ('https://www.blockonomics.co/',
|
||||
{'tx': 'api/tx?txid=', 'addr': '#/search?q='}),
|
||||
'OXT.me': ('https://oxt.me/',
|
||||
{'tx': 'transaction/', 'addr': 'address/'}),
|
||||
'Florincoin.info': ('https://florincoin.info/',
|
||||
{'tx': 'transactions/', 'addr': 'address/'}),
|
||||
'system default': ('blockchain:/',
|
||||
{'tx': 'tx/', 'addr': 'address/'}),
|
||||
{'tx': 'tx/', 'addr': 'address/'})
|
||||
}
|
||||
|
||||
testnet_block_explorers = {
|
||||
'Blocktrail.com': ('https://www.blocktrail.com/tBTC/',
|
||||
{'tx': 'tx/', 'addr': 'address/'}),
|
||||
'testnet.Florincoin.info': ('https://testnet.florincoin.info/',
|
||||
{'tx': 'transactions/', 'addr': 'address/'}),
|
||||
'system default': ('blockchain://000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943/',
|
||||
{'tx': 'tx/', 'addr': 'address/'}),
|
||||
{'tx': 'tx/', 'addr': 'address/'})
|
||||
}
|
||||
|
||||
def block_explorer_info():
|
||||
@ -628,7 +602,7 @@ def block_explorer_info():
|
||||
return testnet_block_explorers if constants.net.TESTNET else mainnet_block_explorers
|
||||
|
||||
def block_explorer(config):
|
||||
return config.get('block_explorer', 'Blocktrail.com')
|
||||
return config.get('block_explorer', 'Florincoin.info')
|
||||
|
||||
def block_explorer_tuple(config):
|
||||
return block_explorer_info().get(block_explorer(config))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user