diff --git a/node/status.go b/node/status.go index 3083480d1d15816e0c58c4d3a68d1d949084af2b..dab1b302469435705033da9806db6217dbcf11ba 100644 --- a/node/status.go +++ b/node/status.go @@ -138,13 +138,14 @@ func (m *statusManager) propagateStatus(ctx context.Context) error { } func (m *statusManager) mergeRemoteStatuses(remote []*pb.Status) { - if m.self != nil { - remote = withoutNode(remote, m.self.Name) + if len(remote) == 0 { + return } - s := []*pb.Status{m.self} - if len(remote) > 0 { - adds := mergeNodes(m.statuses, remote) - s = append(s, adds...) + + s := mergeNodes(m.statuses, remote) + if m.self != nil { + s = withoutNode(s, m.self.Name) + s = append([]*pb.Status{m.self}, s...) } m.statuses = s }