neutrinonotify: use epochqueue to notify block epochs

This commit is contained in:
Johan T. Halseth committed 2018-03-28 08:13:10 +02:00
1 parent 2b00e01c53
commit 891fb20622
1 file changed
+5 -15
+5 -15
View File
@@ -528,24 +528,14 @@ func (n *NeutrinoNotifier) notifyBlockEpochs(newHeight int32, newSha *chainhash.
}
for _, epochClient := range n.blockEpochClients {
n.wg.Add(1)
epochClient.wg.Add(1)
go func(ntfnChan chan *chainntnfs.BlockEpoch, cancelChan chan struct{},
clientWg *sync.WaitGroup) {
select {
defer clientWg.Done()
defer n.wg.Done()
case epochClient.epochQueue.ChanIn() <- epoch:
select {
case ntfnChan <- epoch:
case <-epochClient.cancelChan:
case <-cancelChan:
return
case <-n.quit:
return
}
}(epochClient.epochChan, epochClient.cancelChan, &epochClient.wg)
case <-n.quit:
}
}
}