Original repository: 250b4f1dcc/bdk_chain
Co-authored-by: Steve Myers <steve@notmandatory.org>
Co-authored-by: 志宇 <hello@evanlinjin.me>
Co-authored-by: LLFourn <lloyd.fourn@gmail.com>
Co-authored-by: rajarshimaitra <rajarshi149@gmail.com>
Co-authored-by: LagginTimes <wzc110@gmail.com>
Co-authored-by: Steve Myers <steve@notmandatory.org>
Co-authored-by: Vladimir Fomene <vladimirfomene@gmail.com>
17 lines
497 B
Rust
17 lines
497 B
Rust
use crate::miniscript::{Descriptor, DescriptorPublicKey};
|
|
|
|
/// A trait to extend the functionality of a miniscript descriptor.
|
|
pub trait DescriptorExt {
|
|
/// Returns the minimum value (in satoshis) that an output should have to be broadcastable.
|
|
fn dust_value(&self) -> u64;
|
|
}
|
|
|
|
impl DescriptorExt for Descriptor<DescriptorPublicKey> {
|
|
fn dust_value(&self) -> u64 {
|
|
self.at_derivation_index(0)
|
|
.script_pubkey()
|
|
.dust_value()
|
|
.to_sat()
|
|
}
|
|
}
|