-
Notifications
You must be signed in to change notification settings - Fork 636
Add option to allow for dust when checking outputs #907
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
base: master
Are you sure you want to change the base?
Conversation
You mentioned you need this for |
If the op return output is over the standard 80 byte limit it is considered dust. |
Ah yes. So you'd need a non-standard implementation of a chain backend to propagate such an output in the first place... |
Yeah I use Libre relay |
wallet/txrules/rules.go
Outdated
@@ -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 { |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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!
this might actually be a better fix: btcsuite/btcd#2380 |
return nil | ||
} | ||
|
||
// CheckOutput performs simple consensus and policy tests on a transaction |
There was a problem hiding this comment.
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.
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. |
This seems standard in most wallet libraries nowadays to give users the option to allow for dust if they know what they are doing.