commit a74e49ea31a6c4ff9f218e44df111e0a9d8ae8ca
parent 0a648e2b1cdb7852d80c0626c62984ef01c1c7e9
Author: ThomasV <thomasv@electrum.org>
Date: Wed, 18 Oct 2017 10:37:10 +0200
Merge pull request #3057 from SomberNight/greenaddress_maintenance1
maintenance for greenaddress plugin
Diffstat:
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/plugins/greenaddress_instant/qt.py b/plugins/greenaddress_instant/qt.py
@@ -24,7 +24,7 @@
# SOFTWARE.
import base64
-import urllib
+import urllib.parse
import sys
import requests
@@ -67,7 +67,7 @@ class Plugin(BasePlugin):
window = d.parent
# 1. get the password and sign the verification request
password = None
- if wallet.use_encryption:
+ if wallet.has_password():
msg = _('GreenAddress requires your signature \n'
'to verify that transaction is instant.\n'
'Please enter your password to sign a\n'
@@ -80,20 +80,20 @@ class Plugin(BasePlugin):
QApplication.processEvents() # update the button label
addr = self.get_my_addr(d)
- message = "Please verify if %s is GreenAddress instant confirmed" % tx.hash()
+ message = "Please verify if %s is GreenAddress instant confirmed" % tx.txid()
sig = wallet.sign_message(addr, message, password)
- sig = base64.b64encode(sig)
+ sig = base64.b64encode(sig).decode('ascii')
# 2. send the request
- response = requests.request("GET", ("https://greenaddress.it/verify/?signature=%s&txhash=%s" % (urllib.quote(sig), tx.hash())),
+ response = requests.request("GET", ("https://greenaddress.it/verify/?signature=%s&txhash=%s" % (urllib.parse.quote(sig), tx.txid())),
headers = {'User-Agent': 'Electrum'})
response = response.json()
# 3. display the result
if response.get('verified'):
- d.show_message(_('%s is covered by GreenAddress instant confirmation') % (tx.hash()), title=_('Verification successful!'))
+ d.show_message(_('%s is covered by GreenAddress instant confirmation') % (tx.txid()), title=_('Verification successful!'))
else:
- d.show_critical(_('%s is not covered by GreenAddress instant confirmation') % (tx.hash()), title=_('Verification failed!'))
+ d.show_critical(_('%s is not covered by GreenAddress instant confirmation') % (tx.txid()), title=_('Verification failed!'))
except BaseException as e:
import traceback
traceback.print_exc(file=sys.stdout)