mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-08 09:11:53 +02:00
channeldb+lnwallet: define zero-fee channel type
This commit is contained in:
@@ -278,6 +278,12 @@ func CommitWeight(chanType channeldb.ChannelType) int64 {
|
||||
func HtlcTimeoutFee(chanType channeldb.ChannelType,
|
||||
feePerKw chainfee.SatPerKWeight) btcutil.Amount {
|
||||
|
||||
// For zero-fee HTLC channels, this will always be zero, regardless of
|
||||
// feerate.
|
||||
if chanType.ZeroHtlcTxFee() {
|
||||
return 0
|
||||
}
|
||||
|
||||
if chanType.HasAnchors() {
|
||||
return feePerKw.FeeForWeight(input.HtlcTimeoutWeightConfirmed)
|
||||
}
|
||||
@@ -290,6 +296,12 @@ func HtlcTimeoutFee(chanType channeldb.ChannelType,
|
||||
func HtlcSuccessFee(chanType channeldb.ChannelType,
|
||||
feePerKw chainfee.SatPerKWeight) btcutil.Amount {
|
||||
|
||||
// For zero-fee HTLC channels, this will always be zero, regardless of
|
||||
// feerate.
|
||||
if chanType.ZeroHtlcTxFee() {
|
||||
return 0
|
||||
}
|
||||
|
||||
if chanType.HasAnchors() {
|
||||
return feePerKw.FeeForWeight(input.HtlcSuccessWeightConfirmed)
|
||||
}
|
||||
|
Reference in New Issue
Block a user