Update pywallet.py
Change balance website to blockchain.
This commit is contained in:
parent
880662a31c
commit
35d837efd9
12
pywallet.py
12
pywallet.py
@ -79,7 +79,7 @@ private_hex_keys = []
|
|||||||
passphrase = ""
|
passphrase = ""
|
||||||
global_merging_message = ["",""]
|
global_merging_message = ["",""]
|
||||||
|
|
||||||
balance_site = 'http://jackjack.alwaysdata.net/balance/index.php?address'
|
balance_site = 'https://blockchain.info/q/addressbalance/'
|
||||||
aversions = {};
|
aversions = {};
|
||||||
for i in range(256):
|
for i in range(256):
|
||||||
aversions[i] = "version %d" % i;
|
aversions[i] = "version %d" % i;
|
||||||
@ -2684,14 +2684,8 @@ def importprivkey(db, sec, label, reserve, keyishex, verbose=True, addrv=addrtyp
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def balance(site, address):
|
def balance(site, address):
|
||||||
page=urllib.urlopen("%s=%s" % (site, address))
|
page=urllib.urlopen("%s%s" % (site, address))
|
||||||
json_acc = json.loads(page.read().split("<end>")[0])
|
return page.read()
|
||||||
if json_acc['0'] == 0:
|
|
||||||
return "Invalid address"
|
|
||||||
elif json_acc['0'] == 2:
|
|
||||||
return "Never used"
|
|
||||||
else:
|
|
||||||
return json_acc['balance']
|
|
||||||
|
|
||||||
def read_jsonfile(filename):
|
def read_jsonfile(filename):
|
||||||
filin = open(filename, 'r')
|
filin = open(filename, 'r')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user