Skip to content
This repository has been archived by the owner on Jan 27, 2020. It is now read-only.

Commit

Permalink
wallet: use relay fee to check for dust not fee rate
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Roasbeef committed Jun 19, 2019
1 parent 89ab204 commit 1dccdec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion wallet/wallet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit 1dccdec

Please sign in to comment.