Merge pull request #3534 from alrs/discovery-test-improvements

discovery: Goroutine Test Fixes and Linting
This commit is contained in:
Wilmer Paulino
2019-09-25 16:12:30 -07:00
committed by GitHub
3 changed files with 133 additions and 31 deletions

View File

@@ -1559,7 +1559,7 @@ func (d *AuthenticatedGossiper) processNetworkAnnouncement(
// We'll ignore any channel announcements that target any chain
// other than the set of chains we know of.
if !bytes.Equal(msg.ChainHash[:], d.cfg.ChainHash[:]) {
err := fmt.Errorf("Ignoring ChannelAnnouncement from "+
err := fmt.Errorf("ignoring ChannelAnnouncement from "+
"chain=%v, gossiper on chain=%v", msg.ChainHash,
d.cfg.ChainHash)
log.Errorf(err.Error())
@@ -1720,9 +1720,7 @@ func (d *AuthenticatedGossiper) processNetworkAnnouncement(
var channelUpdates []*networkMsg
d.pChanUpdMtx.Lock()
for _, cu := range d.prematureChannelUpdates[shortChanID] {
channelUpdates = append(channelUpdates, cu)
}
channelUpdates = append(channelUpdates, d.prematureChannelUpdates[shortChanID]...)
// Now delete the premature ChannelUpdates, since we added them
// all to the queue of network messages.
@@ -1785,7 +1783,7 @@ func (d *AuthenticatedGossiper) processNetworkAnnouncement(
// We'll ignore any channel announcements that target any chain
// other than the set of chains we know of.
if !bytes.Equal(msg.ChainHash[:], d.cfg.ChainHash[:]) {
err := fmt.Errorf("Ignoring ChannelUpdate from "+
err := fmt.Errorf("ignoring ChannelUpdate from "+
"chain=%v, gossiper on chain=%v", msg.ChainHash,
d.cfg.ChainHash)
log.Errorf(err.Error())