From 7f480f723c1272aadbe530a8df01d6690ade21a1 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sat, 25 Aug 2018 17:10:57 -0700 Subject: [PATCH] peer: add QuitSignal to ensure peer struct adheres to lnpeer.Peer interface --- peer.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/peer.go b/peer.go index 1edd7368..3ec3cce4 100644 --- a/peer.go +++ b/peer.go @@ -315,6 +315,16 @@ func (p *peer) Start() error { return nil } +// QuitSignal is a method that should return a channel which will be sent upon +// or closed once the backing peer exits. This allows callers using the +// interface to cancel any processing in the event the backing implementation +// exits. +// +// NOTE: Part of the lnpeer.Peer interface. +func (p *peer) QuitSignal() <-chan struct{} { + return p.quit +} + // loadActiveChannels creates indexes within the peer for tracking all active // channels returned by the database. func (p *peer) loadActiveChannels(chans []*channeldb.OpenChannel) error {