-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nodes marked online incorrectly #123
Comments
The behavior you are seeing is intended. Most other communities use aliases.json to display supernodes that do not have any kind of respondd, so they have no valid lastseen but should always be displayed as online. |
I think that would be a good idea. |
You can avoid it appearing in the 'New Nodes' section by setting a {
"deadbeef0001": {
"nodeinfo": {
"node_id": "deadbeef0001",
"hostname": "supernode1"
},
"firstseen": "2017-04-13T15:32:41"
}
} |
@anoymouserver that works for supernodes. setting firstseen or lastseen in the aliases.json would overwrite the info gathered through respondd and thus basically make that information useless for us. |
Yeah, maybe another solution would be to make two seperate files, one "overlay" and one "underlay". Things from the overlay overwrite actual node data, things from the underlay don't. |
We (FFHH) had nodes marked as online despite them never beeing part of the network.
I traced back the issue to the line
hopglass-server/modules/provider/hopglass.js
Line 27 in 7a33a32
and the same line in other providers.
That line basically says: If a node does not have a valid node.lastseen object, treat it as just having a lastseen object that equals now.
We inject node names and location data from an aliases.json file, so nodes usually show up in the aliases.json file first before actually coming online and being detected through announced and it's common to have nodes being registered on our backend without them ever coming online.
I've replaced that line in hopglass.js and other providers with the following line and these nodes are correctly reported as offline now:
return Math.abs((node.lastseen ? new Date(node.lastseen) : new Date(0)) - new Date()) < config.offlineTime * 1000
This treats nodes without a valid node.lastseen object as being last seen on 1.1.1970.
The text was updated successfully, but these errors were encountered: