Send correct Node IDs in cluster config message (fixes #707)

This commit is contained in:
Jakob Borg
2014-09-19 13:21:58 +02:00
parent bf909db3f9
commit b1a31d3b30
2 changed files with 71 additions and 0 deletions

View File

@@ -951,6 +951,9 @@ func (m *Model) clusterConfig(node protocol.NodeID) protocol.ClusterConfigMessag
ID: repo,
}
for _, node := range m.repoNodes[repo] {
// NodeID is a value type, but with an underlying array. Copy it
// so we don't grab aliases to the same array later on in node[:]
node := node
// TODO: Set read only bit when relevant
cr.Nodes = append(cr.Nodes, protocol.Node{
ID: node[:],