Closed JKOK005 closed 4 years ago
Changed to:
glog.Infof("Building finger table %s:%d", myAddr, myPort)
nodeObj := &util.NodeInfo{Addr: myAddr, Port: myPort, IsLocal: true}
data, _ := json.Marshal(nodeObj)
Also adjusted lines 68-70:
json.Unmarshal(nodeData, nodeInfo)
successors[eInt] = *nodeInfo
to
json.Unmarshal(nodeData, nodeInfo)
nodeInfo.IsLocal = false
successors[eInt] = *nodeInfo
Source: FingerTable.go line 38
` 37 >> glog.Infof("Building finger table %s:%d", myAddr, myPort)
38 >> nodeObj := &util.NodeInfo{Addr: myAddr, Port: myPort}
39 >> data, _ := json.Marshal(nodeObj)`
Since NodeInfo has a new field called
isLocal
, not declaring it on initialisation will cause its field to be set to False as default.The
isLocal
field should be set to true since the information pertains to the local node.