Skip to content
Snippets Groups Projects
Commit 824b7544 authored by ale's avatar ale
Browse files

Fixed a logic error when merging remote updates in the status protocol

parent 441853b0
No related branches found
No related tags found
1 merge request!1v2.0
...@@ -138,13 +138,14 @@ func (m *statusManager) propagateStatus(ctx context.Context) error { ...@@ -138,13 +138,14 @@ func (m *statusManager) propagateStatus(ctx context.Context) error {
} }
func (m *statusManager) mergeRemoteStatuses(remote []*pb.Status) { func (m *statusManager) mergeRemoteStatuses(remote []*pb.Status) {
if m.self != nil { if len(remote) == 0 {
remote = withoutNode(remote, m.self.Name) return
} }
s := []*pb.Status{m.self}
if len(remote) > 0 { s := mergeNodes(m.statuses, remote)
adds := mergeNodes(m.statuses, remote) if m.self != nil {
s = append(s, adds...) s = withoutNode(s, m.self.Name)
s = append([]*pb.Status{m.self}, s...)
} }
m.statuses = s m.statuses = s
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment