From a334025883fa1b9d402412720611683b6139fe22 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 14 Sep 2017 13:12:47 +0200 Subject: [PATCH] lnwire: swap order of MinAcceptDepth and HtlcMinimum MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- lnwire/accept_channel.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lnwire/accept_channel.go b/lnwire/accept_channel.go index 020e2827..f738e3c0 100644 --- a/lnwire/accept_channel.go +++ b/lnwire/accept_channel.go @@ -33,14 +33,14 @@ type AcceptChannel struct { // channel's lifetime. 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 // will accept. 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 // in the pay-to-self output of both commitment transactions. CsvDelay uint16 @@ -97,8 +97,8 @@ func (a *AcceptChannel) Encode(w io.Writer, pver uint32) error { a.DustLimit, a.MaxValueInFlight, a.ChannelReserve, - a.MinAcceptDepth, a.HtlcMinimum, + a.MinAcceptDepth, a.CsvDelay, a.MaxAcceptedHTLCs, a.FundingKey, @@ -120,8 +120,8 @@ func (a *AcceptChannel) Decode(r io.Reader, pver uint32) error { &a.DustLimit, &a.MaxValueInFlight, &a.ChannelReserve, - &a.MinAcceptDepth, &a.HtlcMinimum, + &a.MinAcceptDepth, &a.CsvDelay, &a.MaxAcceptedHTLCs, &a.FundingKey,