Using corrected IP address

IP address being received had `:ffff` at the starting, it needs to be corrected before setting correct IP for node. Closes #99
This commit is contained in:
Ayushya Chitransh 2018-02-13 14:52:45 +05:30 committed by EOS Classic
parent 4a879a96c4
commit 43f5d65766
No known key found for this signature in database
GPG Key ID: 0D626A44301D8C5E

View File

@ -102,6 +102,9 @@ Node.prototype.setInfo = function(data, callback)
Node.prototype.setGeo = function(ip)
{
if (ip.substr(0, 7) == "::ffff:") {
ip = ip.substr(7)
}
this.info.ip = ip;
this.geo = geoip.lookup(ip);
}