electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit bea038ea6b88b4c2731300ddc134ac505678b4e4
parent 22861b70ee20e98f0c6306055ee93801ecd56035
Author: SomberNight <somber.night@protonmail.com>
Date:   Thu, 27 Feb 2020 03:31:14 +0100

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.

Diffstat:
Melectrum/gui/qt/transaction_dialog.py | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/electrum/gui/qt/transaction_dialog.py b/electrum/gui/qt/transaction_dialog.py @@ -266,6 +266,14 @@ class BaseTxDialog(QDialog, MessageBoxMixin): 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):