channeldb+lnwallet: define zero-fee channel type
This commit is contained in:
2 files changed
+22
No files matched your search
@@ -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