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

Add option to allow for dust when checking outputs #907

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

benthecarman
Copy link
Contributor

@benthecarman benthecarman commented Jan 27, 2024

This seems standard in most wallet libraries nowadays to give users the option to allow for dust if they know what they are doing.

@guggero
Copy link
Collaborator

guggero commented Dec 9, 2024

You mentioned you need this for OP_RETURN outputs. But those should already be exempt by the check here.
So I don't really see why this is needed? Or how exactly are you creating the OP_RETURN outputs?

@benthecarman
Copy link
Contributor Author

If the op return output is over the standard 80 byte limit it is considered dust.

@guggero
Copy link
Collaborator

guggero commented Dec 9, 2024

Ah yes. So you'd need a non-standard implementation of a chain backend to propagate such an output in the first place...

@benthecarman
Copy link
Contributor Author

Yeah I use Libre relay

@@ -39,14 +39,14 @@ var (

// CheckOutput performs simple consensus and policy tests on a transaction
// output.
func CheckOutput(output *wire.TxOut, relayFeePerKb btcutil.Amount) error {
func CheckOutput(output *wire.TxOut, relayFeePerKb btcutil.Amount, allowDust bool) error {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a breaking API change, should we just create a new function CheckOutputAllowDust that has the boolean flag? Then this function can call into the new one with false.

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

Successfully merging this pull request may close these issues.

2 participants