From 46d5f7dd6e941af22cde869f68999ad8975afb34 Mon Sep 17 00:00:00 2001 From: thomasv Date: Thu, 2 Feb 2012 17:21:02 +0100 Subject: [PATCH] sig warning + lookup from default url --- client/electrum | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/client/electrum b/client/electrum index c16b8ae2c..ccecfd091 100755 --- a/client/electrum +++ b/client/electrum @@ -73,15 +73,25 @@ if __name__ == '__main__': if k=='amount': amount = uv elif k=='label': label = uv elif k =='signature': signature = uv - elif k =='signer': signer = uv + elif k =='signer': + signer = uv + if not wallet.is_valid(signer): + print signer + print "trying canonical URL" + import urllib + url = 'http://'+signer+'/bitcoin.id' + print url + signer = urllib.urlopen(url).read().strip() + print repr(signer) + else: print k,v if k in ['signer','signature']: cmd = cmd.replace('&%s=%s'%(k,v),'') - if signature: - wallet.verify_message(signer, signature, cmd ) - gui.set_send_tab(address, amount, label) + if signature: + if not wallet.verify_message(signer, 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() wallet.save()