mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 14:22:37 +01:00
lnwallet: update HtlcSuccessFee + HtlcTimeoutFee for taproot chans
There's no fee, as taproot channels are always zero fee HTLC.
This commit is contained in:
parent
ebc61818a3
commit
a74c30fbdd
1 changed files with 12 additions and 12 deletions
|
@ -482,17 +482,18 @@ func CommitWeight(chanType channeldb.ChannelType) int64 {
|
||||||
func HtlcTimeoutFee(chanType channeldb.ChannelType,
|
func HtlcTimeoutFee(chanType channeldb.ChannelType,
|
||||||
feePerKw chainfee.SatPerKWeight) btcutil.Amount {
|
feePerKw chainfee.SatPerKWeight) btcutil.Amount {
|
||||||
|
|
||||||
|
switch {
|
||||||
// For zero-fee HTLC channels, this will always be zero, regardless of
|
// For zero-fee HTLC channels, this will always be zero, regardless of
|
||||||
// feerate.
|
// feerate.
|
||||||
if chanType.ZeroHtlcTxFee() {
|
case chanType.ZeroHtlcTxFee() || chanType.IsTaproot():
|
||||||
return 0
|
return 0
|
||||||
}
|
|
||||||
|
|
||||||
if chanType.HasAnchors() {
|
case chanType.HasAnchors():
|
||||||
return feePerKw.FeeForWeight(input.HtlcTimeoutWeightConfirmed)
|
return feePerKw.FeeForWeight(input.HtlcTimeoutWeightConfirmed)
|
||||||
}
|
|
||||||
|
|
||||||
return feePerKw.FeeForWeight(input.HtlcTimeoutWeight)
|
default:
|
||||||
|
return feePerKw.FeeForWeight(input.HtlcTimeoutWeight)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// HtlcSuccessFee returns the fee in satoshis required for an HTLC success
|
// HtlcSuccessFee returns the fee in satoshis required for an HTLC success
|
||||||
|
@ -500,19 +501,18 @@ func HtlcTimeoutFee(chanType channeldb.ChannelType,
|
||||||
func HtlcSuccessFee(chanType channeldb.ChannelType,
|
func HtlcSuccessFee(chanType channeldb.ChannelType,
|
||||||
feePerKw chainfee.SatPerKWeight) btcutil.Amount {
|
feePerKw chainfee.SatPerKWeight) btcutil.Amount {
|
||||||
|
|
||||||
|
switch {
|
||||||
// For zero-fee HTLC channels, this will always be zero, regardless of
|
// For zero-fee HTLC channels, this will always be zero, regardless of
|
||||||
// feerate.
|
// feerate.
|
||||||
if chanType.ZeroHtlcTxFee() {
|
case chanType.ZeroHtlcTxFee() || chanType.IsTaproot():
|
||||||
return 0
|
return 0
|
||||||
}
|
|
||||||
|
|
||||||
// TODO(roasbeef): fee is still off here?
|
case chanType.HasAnchors():
|
||||||
|
|
||||||
if chanType.HasAnchors() {
|
|
||||||
return feePerKw.FeeForWeight(input.HtlcSuccessWeightConfirmed)
|
return feePerKw.FeeForWeight(input.HtlcSuccessWeightConfirmed)
|
||||||
}
|
|
||||||
|
|
||||||
return feePerKw.FeeForWeight(input.HtlcSuccessWeight)
|
default:
|
||||||
|
return feePerKw.FeeForWeight(input.HtlcSuccessWeight)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// CommitScriptAnchors return the scripts to use for the local and remote
|
// CommitScriptAnchors return the scripts to use for the local and remote
|
||||||
|
|
Loading…
Add table
Reference in a new issue