Check for NodeID length
This commit is contained in:
parent
808135904f
commit
53720c3c57
7
main.go
7
main.go
|
@ -89,10 +89,13 @@ func onReceive(addr net.UDPAddr, res *data.ResponseData) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Updates nodes if NodeID found
|
// Updates nodes if NodeID found
|
||||||
if nodeId != "" {
|
if len(nodeId) != 12 {
|
||||||
nodes.Update(nodeId, res)
|
log.Printf("invalid NodeID '%s' from %s", nodeId, addr.String())
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nodes.Update(nodeId, res)
|
||||||
|
|
||||||
if val := res.Statistics; val != nil && statsDb != nil {
|
if val := res.Statistics; val != nil && statsDb != nil {
|
||||||
statsDb.Add(val)
|
statsDb.Add(val)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue