mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 22:25:24 +01:00
discovery/gossiper: reaturn early of no premature to process
This commit is contained in:
parent
d0e8aeece1
commit
c8ce2aa2d2
1 changed files with 7 additions and 4 deletions
|
@ -1139,12 +1139,15 @@ func (d *AuthenticatedGossiper) networkHandler() {
|
|||
d.Lock()
|
||||
numPremature := len(d.prematureAnnouncements[uint32(newBlock.Height)])
|
||||
d.Unlock()
|
||||
if numPremature != 0 {
|
||||
log.Infof("Re-processing %v premature "+
|
||||
"announcements for height %v",
|
||||
numPremature, blockHeight)
|
||||
|
||||
// Return early if no announcement to process.
|
||||
if numPremature == 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
log.Infof("Re-processing %v premature announcements "+
|
||||
"for height %v", numPremature, blockHeight)
|
||||
|
||||
d.Lock()
|
||||
for _, ann := range d.prematureAnnouncements[uint32(newBlock.Height)] {
|
||||
emittedAnnouncements := d.processNetworkAnnouncement(ann)
|
||||
|
|
Loading…
Add table
Reference in a new issue