Skip to content

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Damn never saw this comment, updated!

@benthecarman
Copy link
Contributor Author

this might actually be a better fix: btcsuite/btcd#2380

return nil
}

// CheckOutput performs simple consensus and policy tests on a transaction

Choose a reason for hiding this comment

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

The comment here should be updated to match the function.

@kcalvinalvin
Copy link

this might actually be a better fix: btcsuite/btcd#2380

btcsuite/btcd#2380 (comment)

I think if the main goal is to fix btcwallet considering op_returns as dust, I think changing the behavior in btcwallet is the way to go because of the aforementioned comment here.

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.

3 participants