fix ro address import
This commit is contained in:
parent
559efbfbc0
commit
6a54e3e927
25
pywallet.py
25
pywallet.py
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
#-*- coding: utf-8 -*-
|
#-*- coding: utf-8 -*-
|
||||||
pywversion="2.0.3"
|
pywversion="2.0.4"
|
||||||
never_update=False
|
never_update=False
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -4143,18 +4143,19 @@ if 'twisted' not in missing_dep:
|
|||||||
try:
|
try:
|
||||||
pub=request.args['pub'][0]
|
pub=request.args['pub'][0]
|
||||||
try:
|
try:
|
||||||
wdir=request.args['dir'][0]
|
wdir=request.args['dir'][0]
|
||||||
wname=request.args['name'][0]
|
wname=request.args['name'][0]
|
||||||
addrtype = int(request.args['vers'][0])
|
addrtype = int(request.args['vers'][0])
|
||||||
label=request.args['label'][0]
|
label=request.args['label'][0]
|
||||||
|
|
||||||
db_env = create_env(wdir)
|
db_env = create_env(wdir)
|
||||||
db = open_wallet(db_env, wname, writable=True)
|
db = open_wallet(db_env, wname, writable=True)
|
||||||
update_wallet(db, 'ckey', { 'public_key' : pub.decode('hex'), 'encrypted_private_key' : random_string(96).decode('hex') })
|
update_wallet(db, 'ckey', { 'public_key' : pub.decode('hex'), 'encrypted_private_key' : random_string(96).decode('hex') })
|
||||||
db.close()
|
update_wallet(db, 'name', { 'hash' : public_key_to_bc_address(pub.decode('hex')), 'name' : "Read-only: "+label })
|
||||||
return "Read-only address "+public_key_to_bc_address(pub.decode('hex'))+" imported"
|
db.close()
|
||||||
|
return "Read-only address "+public_key_to_bc_address(pub.decode('hex'))+" imported"
|
||||||
except:
|
except:
|
||||||
return "Read-only address "+public_key_to_bc_address(pub.decode('hex'))+" not imported"
|
return "Read-only address "+public_key_to_bc_address(pub.decode('hex'))+" not imported"
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user