neutrinonotify: use epochqueue to notify block epochs
This commit is contained in:
parent
2b00e01c53
commit
891fb20622
@ -528,24 +528,14 @@ func (n *NeutrinoNotifier) notifyBlockEpochs(newHeight int32, newSha *chainhash.
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, epochClient := range n.blockEpochClients {
|
for _, epochClient := range n.blockEpochClients {
|
||||||
n.wg.Add(1)
|
select {
|
||||||
epochClient.wg.Add(1)
|
|
||||||
go func(ntfnChan chan *chainntnfs.BlockEpoch, cancelChan chan struct{},
|
|
||||||
clientWg *sync.WaitGroup) {
|
|
||||||
|
|
||||||
defer clientWg.Done()
|
case epochClient.epochQueue.ChanIn() <- epoch:
|
||||||
defer n.wg.Done()
|
|
||||||
|
|
||||||
select {
|
case <-epochClient.cancelChan:
|
||||||
case ntfnChan <- epoch:
|
|
||||||
|
|
||||||
case <-cancelChan:
|
case <-n.quit:
|
||||||
return
|
}
|
||||||
|
|
||||||
case <-n.quit:
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}(epochClient.epochChan, epochClient.cancelChan, &epochClient.wg)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user