From 09d4660524396cffd387c7bf0a1bfdf8cf76fe03 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 6 Sep 2018 16:48:50 -0700 Subject: [PATCH] chanseries: fix panic bug by ensuring we access a non-nil edge In this commit, we fix an existing but that would cause the daemon to at times crash. Before this commit, we access the wrong edge, which would possibly actually be nil, leading to a panic. In this commit we fix this by ensuring we access the proper edge which is known to be non-nil at this point in the control flow. --- chan_series.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chan_series.go b/chan_series.go index ecc29ee2..27a1c3e6 100644 --- a/chan_series.go +++ b/chan_series.go @@ -297,7 +297,7 @@ func (c *chanSeries) FetchChanUpdates(chain chainhash.Hash, HtlcMinimumMsat: e2.MinHTLC, BaseFee: uint32(e2.FeeBaseMSat), FeeRate: uint32(e2.FeeProportionalMillionths), - ExtraOpaqueData: e1.ExtraOpaqueData, + ExtraOpaqueData: e2.ExtraOpaqueData, } chanUpdate.Signature, err = lnwire.NewSigFromRawSignature(e2.SigBytes) if err != nil {