Skip to content

Commit

Permalink
Qt tx dialog: warn if user asked for full bip32 paths but info missing
Browse files Browse the repository at this point in the history
related: #5969 (comment)

Instead of a log line, maybe it should warn as part of the GUI.. but this is a start.
  • Loading branch information
SomberNight committed Feb 27, 2020
1 parent 22861b7 commit bea038e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions electrum/gui/qt/transaction_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,14 @@ def _gettx_for_hardware_device(self) -> PartialTransaction:
raise Exception("Can only export partial transactions for hardware device.")
tx = copy.deepcopy(self.tx)
tx.add_info_from_wallet(self.wallet, include_xpubs_and_full_paths=True)
# log warning if PSBT_*_BIP32_DERIVATION fields cannot be filled with full path due to missing info
from electrum.keystore import Xpub
def is_ks_missing_info(ks):
return (isinstance(ks, Xpub) and (ks.get_root_fingerprint() is None
or ks.get_derivation_prefix() is None))
if any([is_ks_missing_info(ks) for ks in self.wallet.get_keystores()]):
_logger.warning('PSBT was requested to be filled with full bip32 paths but '
'some keystores lacked either the derivation prefix or the root fingerprint')
return tx

def copy_to_clipboard(self, *, tx: Transaction = None):
Expand Down

0 comments on commit bea038e

Please sign in to comment.