peer: add QuitSignal to ensure peer struct adheres to lnpeer.Peer interface

This commit is contained in:
Olaoluwa Osuntokun 2018-08-25 17:10:57 -07:00
parent 1364dca5a6
commit 7f480f723c
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

10
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 {