lnwallet: update CommitWeight to return taproot commit weight
This commit is contained in:
1 file changed
+10
-5
+10
-5
@@ -464,12 +464,17 @@ 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
|
||||||
}
|
|
||||||
|
|
||||||
return input.CommitWeight
|
// If this commitment has anchors, it will be slightly heavier.
|
||||||
|
case chanType.HasAnchors():
|
||||||
|
return input.AnchorCommitWeight
|
||||||
|
|
||||||
|
default:
|
||||||
|
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
|
||||||
|
|||||||
Reference in new issue
Block a user