From 87d3688ed74c412190cedf5b1e93719de0881a23 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Tue, 2 Dec 2014 03:58:26 +0100 Subject: [PATCH] update bitcore to insight in tx_api.py --- trezorlib/tx_api.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/trezorlib/tx_api.py b/trezorlib/tx_api.py index 12df49f..84389f0 100644 --- a/trezorlib/tx_api.py +++ b/trezorlib/tx_api.py @@ -51,7 +51,7 @@ def opcode_serialize(opcode): except: raise Exception('Unknown script opcode: %s' % opcode) -def bitcore_tx(url): +def insight_tx(url): f = urllib2.urlopen(url) data = json.load(f) @@ -66,8 +66,8 @@ def bitcore_tx(url): i.prev_index = 0xffffffff # signed int -1 i.script_sig = binascii.unhexlify(vin['coinbase']) i.sequence = vin['sequence'] - - else: + + else: i.prev_hash = binascii.unhexlify(vin['txid']) i.prev_index = vin['vout'] asm = vin['scriptSig']['asm'].split(' ') @@ -88,12 +88,12 @@ class TXAPIBitcoin(object): @filecache(MONTH) def get_tx(self, txhash): - url = 'http://live.bitcore.io/api/tx/%s' % txhash - return bitcore_tx(url) + url = 'https://insight.bitpay.com/api/tx/%s' % txhash + return insight_tx(url) class TXAPITestnet(object): @filecache(MONTH) def get_tx(self, txhash): - url = 'http://test.bitcore.io/api/tx/%s' % txhash - return bitcore_tx(url) + url = 'https://insight.bitpay.com/api/tx/%s' % txhash + return insight_tx(url)