mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-10 15:13:22 +02:00
lnwire: fix encoding of MilliSatoshi
`MilliSatoshi` itself is already a `BigSize`, we just need to change the decoding and encoding types to use that.
This commit is contained in:
@@ -76,8 +76,8 @@ func (dc *DynCommit) Decode(r io.Reader, _ uint32) error {
|
||||
|
||||
// Prepare receiving buffers to be filled by TLV extraction.
|
||||
var dustLimit tlv.RecordT[tlv.TlvType0, tlv.BigSizeT[btcutil.Amount]]
|
||||
var maxValue tlv.RecordT[tlv.TlvType2, uint64]
|
||||
var htlcMin tlv.RecordT[tlv.TlvType4, uint64]
|
||||
var maxValue tlv.RecordT[tlv.TlvType2, MilliSatoshi]
|
||||
var htlcMin tlv.RecordT[tlv.TlvType4, MilliSatoshi]
|
||||
var reserve tlv.RecordT[tlv.TlvType6, tlv.BigSizeT[btcutil.Amount]]
|
||||
csvDelay := dc.CsvDelay.Zero()
|
||||
maxHtlcs := dc.MaxAcceptedHTLCs.Zero()
|
||||
@@ -100,12 +100,12 @@ func (dc *DynCommit) Decode(r io.Reader, _ uint32) error {
|
||||
}
|
||||
if val, ok := typeMap[dc.MaxValueInFlight.TlvType()]; ok && val == nil {
|
||||
var rec tlv.RecordT[tlv.TlvType2, MilliSatoshi]
|
||||
rec.Val = MilliSatoshi(maxValue.Val)
|
||||
rec.Val = maxValue.Val
|
||||
dc.MaxValueInFlight = tlv.SomeRecordT(rec)
|
||||
}
|
||||
if val, ok := typeMap[dc.HtlcMinimum.TlvType()]; ok && val == nil {
|
||||
var rec tlv.RecordT[tlv.TlvType4, MilliSatoshi]
|
||||
rec.Val = MilliSatoshi(htlcMin.Val)
|
||||
rec.Val = htlcMin.Val
|
||||
dc.HtlcMinimum = tlv.SomeRecordT(rec)
|
||||
}
|
||||
if val, ok := typeMap[dc.ChannelReserve.TlvType()]; ok && val == nil {
|
||||
|
Reference in New Issue
Block a user