1
0

add payto identity field to gui

This commit is contained in:
thomasv
2012-02-02 18:44:50 +01:00
parent 9d722db1f4
commit 662501b68f
2 changed files with 39 additions and 12 deletions

View File

@@ -75,22 +75,24 @@ if __name__ == '__main__':
elif k =='signature': signature = uv
elif k =='identity':
identity = uv
if not wallet.is_valid(identity):
if wallet.is_valid(identity):
signing_address = identity
else:
import urllib
url = 'http://'+identity+'/bitcoin.id'
try:
identity = urllib.urlopen(url).read().strip()
signing_address = urllib.urlopen(url).read().strip()
except:
# no need to display something, the signature verification will fail anyway
pass
# no need to display anything since verification will fail
signing_address = ''
else: print k,v
if k in ['identity','signature']:
cmd = cmd.replace('&%s=%s'%(k,v),'')
gui.set_send_tab(address, amount, label)
gui.set_send_tab(address, amount, label, identity)
if signature:
if not wallet.verify_message(identity, signature, cmd ):
if not wallet.verify_message(signing_address, signature, cmd ):
gui.show_message('Warning: the URI contains a bad signature.\nThe identity of the recipient cannot be verified.\nPay at your own risks!')
gui.main()