chanfitness: only process online events for peers with channels
This commit is contained in:
1 file changed
+8
-5
@@ -313,12 +313,15 @@ func (c *ChannelEventStore) closeChannel(channelPoint wire.OutPoint,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// peerEvent creates a peer monitor for a peer if we do not currently have
|
// peerEvent adds an online event to a peer's monitor. If the peer is not
|
||||||
// one, and adds an online event to it.
|
// yet known to the event store, the event is ignored. A peer is only known to
|
||||||
|
// the event store if we have an open channel with them.
|
||||||
func (c *ChannelEventStore) peerEvent(peer route.Vertex, online bool) {
|
func (c *ChannelEventStore) peerEvent(peer route.Vertex, online bool) {
|
||||||
peerMonitor, err := c.getPeerMonitor(peer)
|
peerMonitor, ok := c.peers[peer]
|
||||||
if err != nil {
|
if !ok {
|
||||||
log.Error("could not create monitor: %v", err)
|
log.Tracef("Ignore peer event (online=%v) from non-channel "+
|
||||||
|
"peer: %v", online, peer)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user