lnwire: remove FundingKey from DynPropose and DynCommit
This commit is contained in:
1 parent
cbca5b1152
commit
f40530e4f4
3 files changed
+2
-59
No files matched your search
+1
-19
@@ -4,7 +4,6 @@ import (
|
||||
"bytes"
|
||||
"io"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec/v2"
|
||||
"github.com/btcsuite/btcd/btcutil"
|
||||
"github.com/lightningnetwork/lnd/fn/v2"
|
||||
"github.com/lightningnetwork/lnd/tlv"
|
||||
@@ -83,14 +82,6 @@ func (dc *DynCommit) Encode(w *bytes.Buffer, _ uint32) error {
|
||||
),
|
||||
)
|
||||
})
|
||||
dc.FundingKey.WhenSome(func(key btcec.PublicKey) {
|
||||
keyScratch := &key
|
||||
tlvRecords = append(
|
||||
tlvRecords, tlv.MakePrimitiveRecord(
|
||||
DPFundingPubkey, &keyScratch,
|
||||
),
|
||||
)
|
||||
})
|
||||
dc.ChannelType.WhenSome(func(ty ChannelType) {
|
||||
tlvRecords = append(
|
||||
tlvRecords, tlv.MakeDynamicRecord(
|
||||
@@ -159,11 +150,6 @@ func (dc *DynCommit) Decode(r io.Reader, _ uint32) error {
|
||||
DPMaxAcceptedHtlcs, &maxHtlcsScratch,
|
||||
)
|
||||
|
||||
var fundingKeyScratch *btcec.PublicKey
|
||||
fundingKey := tlv.MakePrimitiveRecord(
|
||||
DPFundingPubkey, &fundingKeyScratch,
|
||||
)
|
||||
|
||||
var chanTypeScratch ChannelType
|
||||
chanType := tlv.MakeDynamicRecord(
|
||||
DPChannelType, &chanTypeScratch, chanTypeScratch.featureBitLen,
|
||||
@@ -172,8 +158,7 @@ func (dc *DynCommit) Decode(r io.Reader, _ uint32) error {
|
||||
|
||||
// Create set of Records to read TLV bytestream into.
|
||||
records := []tlv.Record{
|
||||
dustLimit, maxValue, reserve, csvDelay, maxHtlcs, fundingKey,
|
||||
chanType,
|
||||
dustLimit, maxValue, reserve, csvDelay, maxHtlcs, chanType,
|
||||
}
|
||||
tlv.SortRecords(records)
|
||||
|
||||
@@ -205,9 +190,6 @@ func (dc *DynCommit) Decode(r io.Reader, _ uint32) error {
|
||||
if val, ok := typeMap[DPMaxAcceptedHtlcs]; ok && val == nil {
|
||||
dc.MaxAcceptedHTLCs = fn.Some(maxHtlcsScratch)
|
||||
}
|
||||
if val, ok := typeMap[DPFundingPubkey]; ok && val == nil {
|
||||
dc.FundingKey = fn.Some(*fundingKeyScratch)
|
||||
}
|
||||
if val, ok := typeMap[DPChannelType]; ok && val == nil {
|
||||
dc.ChannelType = fn.Some(chanTypeScratch)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user