From 022148613ea80be28a209be37307cde8a6b9b046 Mon Sep 17 00:00:00 2001 From: William Banfield Date: Wed, 29 Sep 2021 16:54:22 -0400 Subject: [PATCH] fix --- internal/statesync/reactor.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/statesync/reactor.go b/internal/statesync/reactor.go index cd20b5895..c084a1936 100644 --- a/internal/statesync/reactor.go +++ b/internal/statesync/reactor.go @@ -247,9 +247,11 @@ func (r *Reactor) OnStop() { // wait for any remaining requests to complete <-r.dispatcher.Done() - r.syncer.Close() + if r.syncer != nil { + r.syncer.Close() - <-r.dispatcher.Done() + <-r.syncer.Done() + } // Close closeCh to signal to all spawned goroutines to gracefully exit. All // p2p Channels should execute Close().