From 2f08337ccd0b22619344d8a357faa8f8a018fab3 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 20 Apr 2017 16:06:35 -0700 Subject: [PATCH] test: allow lightningNetworkWatcher to gracefully exit when ntfn pending --- networktest.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/networktest.go b/networktest.go index b161ce03..44d3e457 100644 --- a/networktest.go +++ b/networktest.go @@ -397,7 +397,11 @@ func (l *lightningNode) lightningNetworkWatcher() { panic(fmt.Errorf("unable read update ntfn: %v", err)) } - graphUpdates <- update + select { + case graphUpdates <- update: + case <-l.quit: + return + } } }()