installer: disallow xpub with-appended derivation path

close #576
This commit is contained in:
edouard 2023-07-20 15:32:21 +02:00
parent 7ae84a22d2
commit 869f3ec3d2
2 changed files with 5 additions and 3 deletions

View File

@ -883,7 +883,9 @@ impl DescriptorEditModal for EditXpubModal {
message::ImportKeyModal::XPubEdited(s) => {
if let Ok(DescriptorPublicKey::XPub(key)) = DescriptorPublicKey::from_str(&s) {
self.chosen_signer = None;
if let Some((fingerprint, _)) = key.origin {
if !key.derivation_path.is_master() {
self.form_xpub.valid = false;
} else if let Some((fingerprint, _)) = key.origin {
self.form_xpub.valid = true;
if let Some(alias) = self.keys_aliases.get(&fingerprint) {
self.form_name.valid = true;

View File

@ -1304,9 +1304,9 @@ pub fn edit_key_modal<'a>(
)
})
.warning(if network == bitcoin::Network::Bitcoin {
"Please enter correct xpub with origin"
"Please enter correct xpub with origin and without appended derivation path"
} else {
"Please enter correct tpub with origin"
"Please enter correct tpub with origin and without appended derivation path"
})
.size(20)
.padding(10),