rust-bitcoin / rust-miniscript

Support for Miniscript and Output Descriptors for rust-bitcoin
Creative Commons Zero v1.0 Universal
342 stars 134 forks source link

What are strategies to handle the error return of `max_weigh_to_satisfy` ? #695

Open oleonardolima opened 2 months ago

oleonardolima commented 2 months ago

Maybe upstream could add a field to the Params structure which would refuse to parse un-satiable descriptors. Could you file an issue in rust-miniscript asking for strategies to handle the error return of max_weight_to_satisfy?

Alternately you can just use unwrap_or(usize::MAX) or something silly.

_Originally posted by @apoelstra in https://github.com/bitcoindevkit/bdk/pull/1448#discussion_r1638247558_

apoelstra commented 2 months ago

I think there are a couple takeaways for this crate: