From 1dccdec1c19a7bc286b6da5f2a05e289ae84c7e0 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 18 Jun 2019 17:11:01 -0700 Subject: [PATCH] wallet: use relay fee to check for dust not fee rate In this commit we fix a lingering bug in our output sanity checks that would only show up during time periods of persistently higher fees. Before this commit we would incorrectly use the fee rate instead of the min relay fee when checking an output for dust. This would cause us to mistakenly reject a transaction for having a dust output. We fix this by falling back to using the current min-relayfee. --- wallet/wallet.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wallet/wallet.go b/wallet/wallet.go index f9cce35..9d7b6a3 100644 --- a/wallet/wallet.go +++ b/wallet/wallet.go @@ -3172,7 +3172,10 @@ func (w *Wallet) SendOutputs(outputs []*wire.TxOut, account uint32, // Ensure the outputs to be created adhere to the network's consensus // rules. for _, output := range outputs { - if err := txrules.CheckOutput(output, satPerKb); err != nil { + err := txrules.CheckOutput( + output, txrules.DefaultRelayFeePerKb, + ) + if err != nil { return nil, err } }