diff --git a/liana/src/descriptors/mod.rs b/liana/src/descriptors/mod.rs index 070d954b..cc66bacf 100644 --- a/liana/src/descriptors/mod.rs +++ b/liana/src/descriptors/mod.rs @@ -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