htlcswitch/link: add WaitForShutdown method for testing

This commit is contained in:
Conner Fromknecht 2018-06-26 18:05:39 -07:00
parent 23f2d93402
commit 66c4240234
No known key found for this signature in database
GPG Key ID: 39DE78FBE6ACB0EF

@ -465,6 +465,12 @@ func (l *channelLink) Stop() {
l.wg.Wait() l.wg.Wait()
} }
// WaitForShutdown blocks until the link finishes shutting down, which includes
// termination of all dependent goroutines.
func (l *channelLink) WaitForShutdown() {
l.wg.Wait()
}
// EligibleToForward returns a bool indicating if the channel is able to // EligibleToForward returns a bool indicating if the channel is able to
// actively accept requests to forward HTLC's. We're able to forward HTLC's if // actively accept requests to forward HTLC's. We're able to forward HTLC's if
// we know the remote party's next revocation point. Otherwise, we can't // we know the remote party's next revocation point. Otherwise, we can't