Skip to content

Commit

Permalink
hardware wallets: fix sign_transaction in resstored wallets
Browse files Browse the repository at this point in the history
  • Loading branch information
ecdsa committed Nov 4, 2015
1 parent 55494e4 commit c86ef5e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plugins/btchipwallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ def decrypt_message(self, pubkey, message, password):
self.give_error("Not supported")

def sign_message(self, address, message, password):
if self.has_seed():
return BIP32_HD_Wallet.sign_message(self, address, message, password)
use2FA = False
self.signing = True
self.get_client() # prompt for the PIN before displaying the dialog if necessary
Expand Down Expand Up @@ -352,6 +354,8 @@ def sign_message(self, address, message, password):
return chr(27 + 4 + (signature[0] & 0x01)) + r + s

def sign_transaction(self, tx, password):
if self.has_seed():
return BIP32_HD_Wallet.sign_transaction(self, tx, password)
if tx.is_complete():
return
#if tx.error:
Expand Down
4 changes: 4 additions & 0 deletions plugins/keepkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,8 @@ def decrypt_message(self, pubkey, message, password):
#return str(decrypted_msg)

def sign_message(self, address, message, password):
if self.has_seed():
return BIP32_HD_Wallet.sign_message(self, address, message, password)
if not self.check_proper_device():
give_error('Wrong device or password')
try:
Expand All @@ -461,6 +463,8 @@ def sign_message(self, address, message, password):
return msg_sig.signature

def sign_transaction(self, tx, password):
if self.has_seed():
return BIP32_HD_Wallet.sign_transaction(self, tx, password)
if tx.is_complete():
return
if not self.check_proper_device():
Expand Down
4 changes: 4 additions & 0 deletions plugins/trezor.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,8 @@ def decrypt_message(self, pubkey, message, password):
#return str(decrypted_msg)

def sign_message(self, address, message, password):
if self.has_seed():
return BIP32_HD_Wallet.sign_message(self, address, message, password)
if not self.check_proper_device():
give_error('Wrong device or password')
try:
Expand All @@ -460,6 +462,8 @@ def sign_message(self, address, message, password):
return msg_sig.signature

def sign_transaction(self, tx, password):
if self.has_seed():
return BIP32_HD_Wallet.sign_transaction(self, tx, password)
if tx.is_complete():
return
if not self.check_proper_device():
Expand Down

0 comments on commit c86ef5e

Please sign in to comment.