Skip to content

Commit 92a6033

Browse files
committed
Add option to allow for dust when checking outputs
1 parent 16b422a commit 92a6033

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wallet/txrules/rules.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ var (
3939

4040
// CheckOutput performs simple consensus and policy tests on a transaction
4141
// output.
42-
func CheckOutput(output *wire.TxOut, relayFeePerKb btcutil.Amount) error {
42+
func CheckOutput(output *wire.TxOut, relayFeePerKb btcutil.Amount, allowDust bool) error {
4343
if output.Value < 0 {
4444
return ErrAmountNegative
4545
}
4646
if output.Value > btcutil.MaxSatoshi {
4747
return ErrAmountExceedsMax
4848
}
49-
if IsDustOutput(output, relayFeePerKb) {
49+
if !allowDust && IsDustOutput(output, relayFeePerKb) {
5050
return ErrOutputIsDust
5151
}
5252
return nil

0 commit comments

Comments
 (0)