fix(wallet): compare x_only_pubkey when checking if wallet can unlock p2pk

This commit is contained in:
thesimplekid
2024-05-29 22:33:09 +01:00
parent d8fabf6ddd
commit cb89c3ccbd

View File

@@ -1336,7 +1336,7 @@ impl Wallet {
let pubkey_secret_key = match &signing_keys {
Some(signing_keys) => signing_keys
.iter()
.map(|s| (s.public_key().to_string(), s))
.map(|s| (s.public_key().x_only_public_key(), s))
.collect(),
None => HashMap::new(),
};
@@ -1385,7 +1385,9 @@ impl Wallet {
}
}
for pubkey in pubkeys {
if let Some(signing) = pubkey_secret_key.get(&pubkey.to_string()) {
if let Some(signing) =
pubkey_secret_key.get(&pubkey.x_only_public_key())
{
proof.sign_p2pk(signing.to_owned().clone())?;
}
}