watch-only wallets can't sign or decrypt messages
This commit is contained in:
parent
5095687d63
commit
d56dba8039
|
@ -2119,6 +2119,9 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||||
if not bitcoin.is_address(address):
|
if not bitcoin.is_address(address):
|
||||||
self.show_message(_('Invalid Bitcoin address.'))
|
self.show_message(_('Invalid Bitcoin address.'))
|
||||||
return
|
return
|
||||||
|
if self.wallet.is_watching_only():
|
||||||
|
self.show_message(_('This is a watching-only wallet.'))
|
||||||
|
return
|
||||||
if not self.wallet.is_mine(address):
|
if not self.wallet.is_mine(address):
|
||||||
self.show_message(_('Address not in wallet.'))
|
self.show_message(_('Address not in wallet.'))
|
||||||
return
|
return
|
||||||
|
@ -2189,6 +2192,9 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
|
||||||
|
|
||||||
@protected
|
@protected
|
||||||
def do_decrypt(self, message_e, pubkey_e, encrypted_e, password):
|
def do_decrypt(self, message_e, pubkey_e, encrypted_e, password):
|
||||||
|
if self.wallet.is_watching_only():
|
||||||
|
self.show_message(_('This is a watching-only wallet.'))
|
||||||
|
return
|
||||||
cyphertext = encrypted_e.toPlainText()
|
cyphertext = encrypted_e.toPlainText()
|
||||||
task = partial(self.wallet.decrypt_message, pubkey_e.text(), cyphertext, password)
|
task = partial(self.wallet.decrypt_message, pubkey_e.text(), cyphertext, password)
|
||||||
self.wallet.thread.add(task, on_success=lambda text: message_e.setText(text.decode('utf-8')))
|
self.wallet.thread.add(task, on_success=lambda text: message_e.setText(text.decode('utf-8')))
|
||||||
|
|
Loading…
Reference in New Issue