Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
oleonardolima opened this issue Jun 13, 2024 · 1 comment

Comments

@oleonardolima
Copy link

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 bitcoindevkit/bdk#1448 (comment)

@apoelstra
Copy link
Member

I think there are a couple takeaways for this crate:

  • We should update the docs for max_weight_to_satisfy suggesting that users use .unwrap_or(Weight::MAX) if they want to avoid the error paths here.
  • We maybe should add an ExtParams flag that would let people refuse to parse unsatisfiable descriptors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants