From 54f67f72b1355f88c9717f753a4881a01bc1328b Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Mon, 20 Aug 2018 14:28:09 +0200 Subject: [PATCH] discovery/gossiper: define ErrGossiperShuttingDown --- discovery/gossiper.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/discovery/gossiper.go b/discovery/gossiper.go index 28e09f25..c75f3f61 100644 --- a/discovery/gossiper.go +++ b/discovery/gossiper.go @@ -31,6 +31,10 @@ var ( // AnnounceSignatures messages, by persisting them until a send // operation has succeeded. messageStoreKey = []byte("message-store") + + // ErrGossiperShuttingDown is an error that is returned if the gossiper + // is in the process of being shut down. + ErrGossiperShuttingDown = errors.New("gossiper is shutting down") ) // networkMsg couples a routing related wire message with the peer that @@ -476,7 +480,7 @@ func (d *AuthenticatedGossiper) ProcessRemoteAnnouncement(msg lnwire.Message, select { case d.networkMsgs <- nMsg: case <-d.quit: - nMsg.err <- errors.New("gossiper has shut down") + nMsg.err <- ErrGossiperShuttingDown } return nMsg.err @@ -502,7 +506,7 @@ func (d *AuthenticatedGossiper) ProcessLocalAnnouncement(msg lnwire.Message, select { case d.networkMsgs <- nMsg: case <-d.quit: - nMsg.err <- errors.New("gossiper has shut down") + nMsg.err <- ErrGossiperShuttingDown } return nMsg.err