liana: implement LianaDescriptor::contains_fingerprint()

This commit is contained in:
pythcoiner 2025-03-25 06:33:19 +01:00
parent 8a8b4dafcd
commit fa8fd4782f
No known key found for this signature in database
GPG Key ID: C1048AEEDF303B88

View File

@ -1,6 +1,7 @@
use miniscript::{
bitcoin::{
self, bip32,
self,
bip32::{self, Fingerprint},
constants::WITNESS_SCALE_FACTOR,
psbt::{Input as PsbtIn, Output as PsbtOut, Psbt},
secp256k1,
@ -210,6 +211,12 @@ impl LianaDescriptor {
})
}
/// Whether a key matching this fingerprint is part of this descriptor
pub fn contains_fingerprint(&self, fg: Fingerprint) -> bool {
self.multi_desc
.for_any_key(|k| k.master_fingerprint() == fg)
}
/// Get the descriptor for receiving addresses.
pub fn receive_descriptor(&self) -> &SinglePathLianaDesc {
&self.receive_desc