mirror of
https://github.com/ACINQ/eclair.git
synced 2025-02-21 14:04:10 +01:00
Use local dust limit in local commit fee computation (#2765)
Whenever we use the local commit, we must use the local dust limit to trim HTLCs. Similarly, whenever we use the remote commit, we must use the remote dust limit.
This commit is contained in:
parent
ca3f6814a4
commit
a3d90ad18a
1 changed files with 1 additions and 1 deletions
|
@ -506,7 +506,7 @@ case class Commitment(fundingTxIndex: Long,
|
|||
val incomingHtlcs = reduced.htlcs.collect(DirectedHtlc.incoming)
|
||||
|
||||
// note that the initiator pays the fee, so if sender != initiator, both sides will have to afford this payment
|
||||
val fees = commitTxTotalCost(params.remoteParams.dustLimit, reduced, params.commitmentFormat)
|
||||
val fees = commitTxTotalCost(params.localParams.dustLimit, reduced, params.commitmentFormat)
|
||||
// NB: we don't enforce the funderFeeReserve (see sendAdd) because it would confuse a remote initiator that doesn't have this mitigation in place
|
||||
// We could enforce it once we're confident a large portion of the network implements it.
|
||||
val missingForSender = reduced.toRemote - remoteChannelReserve(params) - (if (params.localParams.isInitiator) 0.sat else fees)
|
||||
|
|
Loading…
Add table
Reference in a new issue