discovery/gossiper: reaturn early of no premature to process
This commit is contained in:
1 file changed
+7
-4
@@ -1139,12 +1139,15 @@ func (d *AuthenticatedGossiper) networkHandler() {
|
|||||||
d.Lock()
|
d.Lock()
|
||||||
numPremature := len(d.prematureAnnouncements[uint32(newBlock.Height)])
|
numPremature := len(d.prematureAnnouncements[uint32(newBlock.Height)])
|
||||||
d.Unlock()
|
d.Unlock()
|
||||||
if numPremature != 0 {
|
|
||||||
log.Infof("Re-processing %v premature "+
|
// Return early if no announcement to process.
|
||||||
"announcements for height %v",
|
if numPremature == 0 {
|
||||||
numPremature, blockHeight)
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Infof("Re-processing %v premature announcements "+
|
||||||
|
"for height %v", numPremature, blockHeight)
|
||||||
|
|
||||||
d.Lock()
|
d.Lock()
|
||||||
for _, ann := range d.prematureAnnouncements[uint32(newBlock.Height)] {
|
for _, ann := range d.prematureAnnouncements[uint32(newBlock.Height)] {
|
||||||
emittedAnnouncements := d.processNetworkAnnouncement(ann)
|
emittedAnnouncements := d.processNetworkAnnouncement(ann)
|
||||||
|
|||||||
Reference in new issue
Block a user