input: add weight estimation + tests for all taproot witness gen types

This commit is contained in:
Olaoluwa Osuntokun committed 2023-08-22 16:32:44 -07:00
1 parent d3c7c51f7e
commit 405a435a84
5 files changed
+956 -64

No files matched your search

+3 -1
View File
@@ -242,7 +242,9 @@ func NewChannelReservation(capacity, localFundingAmt btcutil.Amount,
// Based on the channel type, we determine the initial commit weight
// and fee.
commitWeight := int64(input.CommitWeight)
if req.CommitType.HasAnchors() {
if req.CommitType.IsTaproot() {
commitWeight = input.TaprootCommitWeight
} else if req.CommitType.HasAnchors() {
commitWeight = int64(input.AnchorCommitWeight)
}
commitFee := req.CommitFeePerKw.FeeForWeight(commitWeight)