lnwire: remove kickoff feerate from propose/commit

This commit is contained in:
Keagan McClelland
2024-10-07 15:37:30 +02:00
committed by yyforyongyu
parent 36f53d74ab
commit cbca5b1152
3 changed files with 2 additions and 66 deletions

View File

@@ -7,7 +7,6 @@ import (
"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/btcutil"
"github.com/lightningnetwork/lnd/fn/v2"
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
"github.com/lightningnetwork/lnd/tlv"
)
@@ -101,14 +100,6 @@ func (dc *DynCommit) Encode(w *bytes.Buffer, _ uint32) error {
),
)
})
dc.KickoffFeerate.WhenSome(func(kickoffFeerate chainfee.SatPerKWeight) {
protoSats := uint32(kickoffFeerate)
tlvRecords = append(
tlvRecords, tlv.MakePrimitiveRecord(
DPKickoffFeerate, &protoSats,
),
)
})
tlv.SortRecords(tlvRecords)
tlvStream, err := tlv.NewStream(tlvRecords...)
@@ -179,15 +170,10 @@ func (dc *DynCommit) Decode(r io.Reader, _ uint32) error {
channelTypeEncoder, channelTypeDecoder,
)
var kickoffFeerateScratch uint32
kickoffFeerate := tlv.MakePrimitiveRecord(
DPKickoffFeerate, &kickoffFeerateScratch,
)
// Create set of Records to read TLV bytestream into.
records := []tlv.Record{
dustLimit, maxValue, reserve, csvDelay, maxHtlcs, fundingKey,
chanType, kickoffFeerate,
chanType,
}
tlv.SortRecords(records)
@@ -225,11 +211,6 @@ func (dc *DynCommit) Decode(r io.Reader, _ uint32) error {
if val, ok := typeMap[DPChannelType]; ok && val == nil {
dc.ChannelType = fn.Some(chanTypeScratch)
}
if val, ok := typeMap[DPKickoffFeerate]; ok && val == nil {
dc.KickoffFeerate = fn.Some(
chainfee.SatPerKWeight(kickoffFeerateScratch),
)
}
if len(tlvRecords) != 0 {
dc.ExtraData = tlvRecords