lnwallet/channel: enforce absolute fee floor of 250 sat/kw

This enforces the _actualized_ fee rate of the  commitment transaction,
rather than the fee floor used for estimation. The new value of 250
sat/kw corresponds to 1 sat/byte, rather than 253 which is only rounded
up during estimation to account for the fact that BOLT 3 rounds down to
the nearest satoshi and that the vbyte fee estimation is lossy.

Previously we would incorrectly fail to sign the next commitment even
though the fee was technically high enough. Restarting with this commit
should solve the issue as long as the channel hasn't already gone to
chain.
This commit is contained in:
Conner Fromknecht committed 2020-04-21 12:37:34 -07:00
1 parent 3ab5899853
commit 89bd58786e
3 files changed
+45 -2

No files matched your search

+6 -1
View File
@@ -9,8 +9,13 @@ import (
const (
// FeePerKwFloor is the lowest fee rate in sat/kw that we should use for
// determining transaction fees.
// estimating transaction fees before signing.
FeePerKwFloor SatPerKWeight = 253
// AbsoluteFeePerKwFloor is the lowest fee rate in sat/kw of a
// transaction that we should ever _create_. This is the the equivalent
// of 1 sat/byte in sat/kw.
AbsoluteFeePerKwFloor SatPerKWeight = 250
)
// SatPerKVByte represents a fee rate in sat/kb.