From 2e2b262999da6288abb46f106c0fd90e5588e208 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sun, 10 Dec 2017 15:46:39 -0800 Subject: [PATCH] autopilot: ensure access to pendingOpens in thread-safe when logging --- autopilot/agent.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/autopilot/agent.go b/autopilot/agent.go index f302f8d4..8ad4a173 100644 --- a/autopilot/agent.go +++ b/autopilot/agent.go @@ -321,7 +321,9 @@ func (a *Agent) controller(startingBalance btcutil.Amount) { } } + pendingMtx.Lock() log.Debugf("Pending channels: %v", spew.Sdump(pendingOpens)) + pendingMtx.Unlock() // With all the updates applied, we'll obtain a set of // the current active channels (confirmed channels),