lnwire: swap order of MinAcceptDepth and HtlcMinimum
In this commit we reverse the ordering of the MinAcceptDepth and HltcMinimum fields within the AcceptChannel message. Previously, the order of these two fields were reversed, meaning the remote peer would’ve attempted to parse the MinAcceptDepth (as we intended), as part of the HtlcMinimum, leading to a garbage value.
This commit is contained in:
parent
f01f83f938
commit
a334025883
@ -33,14 +33,14 @@ type AcceptChannel struct {
|
|||||||
// channel's lifetime.
|
// channel's lifetime.
|
||||||
ChannelReserve btcutil.Amount
|
ChannelReserve btcutil.Amount
|
||||||
|
|
||||||
// MinAcceptDepth is the minimum depth that the initiator of the
|
|
||||||
// channel should wait before considering the channel open.
|
|
||||||
MinAcceptDepth uint32
|
|
||||||
|
|
||||||
// HtlcMinimum is the smallest HTLC that the sender of this message
|
// HtlcMinimum is the smallest HTLC that the sender of this message
|
||||||
// will accept.
|
// will accept.
|
||||||
HtlcMinimum MilliSatoshi
|
HtlcMinimum MilliSatoshi
|
||||||
|
|
||||||
|
// MinAcceptDepth is the minimum depth that the initiator of the
|
||||||
|
// channel should wait before considering the channel open.
|
||||||
|
MinAcceptDepth uint32
|
||||||
|
|
||||||
// CsvDelay is the number of blocks to use for the relative time lock
|
// CsvDelay is the number of blocks to use for the relative time lock
|
||||||
// in the pay-to-self output of both commitment transactions.
|
// in the pay-to-self output of both commitment transactions.
|
||||||
CsvDelay uint16
|
CsvDelay uint16
|
||||||
@ -97,8 +97,8 @@ func (a *AcceptChannel) Encode(w io.Writer, pver uint32) error {
|
|||||||
a.DustLimit,
|
a.DustLimit,
|
||||||
a.MaxValueInFlight,
|
a.MaxValueInFlight,
|
||||||
a.ChannelReserve,
|
a.ChannelReserve,
|
||||||
a.MinAcceptDepth,
|
|
||||||
a.HtlcMinimum,
|
a.HtlcMinimum,
|
||||||
|
a.MinAcceptDepth,
|
||||||
a.CsvDelay,
|
a.CsvDelay,
|
||||||
a.MaxAcceptedHTLCs,
|
a.MaxAcceptedHTLCs,
|
||||||
a.FundingKey,
|
a.FundingKey,
|
||||||
@ -120,8 +120,8 @@ func (a *AcceptChannel) Decode(r io.Reader, pver uint32) error {
|
|||||||
&a.DustLimit,
|
&a.DustLimit,
|
||||||
&a.MaxValueInFlight,
|
&a.MaxValueInFlight,
|
||||||
&a.ChannelReserve,
|
&a.ChannelReserve,
|
||||||
&a.MinAcceptDepth,
|
|
||||||
&a.HtlcMinimum,
|
&a.HtlcMinimum,
|
||||||
|
&a.MinAcceptDepth,
|
||||||
&a.CsvDelay,
|
&a.CsvDelay,
|
||||||
&a.MaxAcceptedHTLCs,
|
&a.MaxAcceptedHTLCs,
|
||||||
&a.FundingKey,
|
&a.FundingKey,
|
||||||
|
Loading…
Reference in New Issue
Block a user