Browse Source

Qt tx dialog: warn if user asked for full bip32 paths but info missing

related: https://github.com/spesmilo/electrum/issues/5969#issuecomment-591441399

Instead of a log line, maybe it should warn as part of the GUI.. but this is a start.
hard-fail-on-bad-server-string
SomberNight 5 years ago
parent
commit
bea038ea6b
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 8
      electrum/gui/qt/transaction_dialog.py

8
electrum/gui/qt/transaction_dialog.py

@ -266,6 +266,14 @@ class BaseTxDialog(QDialog, MessageBoxMixin):
raise Exception("Can only export partial transactions for hardware device.") raise Exception("Can only export partial transactions for hardware device.")
tx = copy.deepcopy(self.tx) tx = copy.deepcopy(self.tx)
tx.add_info_from_wallet(self.wallet, include_xpubs_and_full_paths=True) 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 return tx
def copy_to_clipboard(self, *, tx: Transaction = None): def copy_to_clipboard(self, *, tx: Transaction = None):

Loading…
Cancel
Save