lnwallet: update CommitWeight to return taproot commit weight

This commit is contained in:
Olaoluwa Osuntokun committed 2023-08-22 16:32:51 -07:00
1 parent 8d0435397d
commit ebc61818a3
1 file changed
+9 -4
+9 -4
View File
@@ -464,13 +464,18 @@ func SecondLevelHtlcScript(chanType channeldb.ChannelType, initiator bool,
// CommitWeight returns the base commitment weight before adding HTLCs. // CommitWeight returns the base commitment weight before adding HTLCs.
func CommitWeight(chanType channeldb.ChannelType) int64 { func CommitWeight(chanType channeldb.ChannelType) int64 {
// If this commitment has anchors, it will be slightly heavier. switch {
if chanType.HasAnchors() { case chanType.IsTaproot():
return input.AnchorCommitWeight return input.TaprootCommitWeight
}
// If this commitment has anchors, it will be slightly heavier.
case chanType.HasAnchors():
return input.AnchorCommitWeight
default:
return input.CommitWeight return input.CommitWeight
} }
}
// HtlcTimeoutFee returns the fee in satoshis required for an HTLC timeout // HtlcTimeoutFee returns the fee in satoshis required for an HTLC timeout
// transaction based on the current fee rate. // transaction based on the current fee rate.