| 35 | type NodeSet map[enode.ID]NodeJSON |
| 36 | |
| 37 | type NodeJSON struct { |
| 38 | Seq uint64 `json:"seq"` |
| 39 | N *enode.Node `json:"record"` |
| 40 | |
| 41 | // The score tracks how many liveness checks were performed. It is incremented by one |
| 42 | // every time the node passes a check, and halved every time it doesn't. |
| 43 | Score int `json:"score,omitempty"` |
| 44 | // These two track the time of last successful contact. |
| 45 | FirstResponse time.Time `json:"firstResponse,omitempty"` |
| 46 | LastResponse time.Time `json:"lastResponse,omitempty"` |
| 47 | // This one tracks the time of our last attempt to contact the node. |
| 48 | LastCheck time.Time `json:"lastCheck,omitempty"` |
| 49 | |
| 50 | Info *ClientInfo `json:"clientInfo,omitempty"` |
| 51 | |
| 52 | TooManyPeers bool `json:"tooManyPeers,omitempty"` |
| 53 | } |
| 54 | |
| 55 | func LoadNodesJSON(file string) NodeSet { |
| 56 | var nodes NodeSet |
nothing calls this directly
no outgoing calls
no test coverage detected