Improve history matching as poor history entries could break "Previous Neighbors" (#307)

This commit is contained in:
Tim Wilkinson 2022-03-19 07:21:22 -07:00 committed by GitHub
parent a716167fa1
commit ce2f47e06d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -399,8 +399,8 @@ end
if nixio.fs.stat("/tmp/node.history") then
for line in io.lines("/tmp/node.history")
do
local ip, age, host = line:match("^(.*) (.*) (.*)")
if age then
local ip, age, host = line:match("^(.+) (%d+) (.*)")
if ip and age and host then
history[ip] = { age = age, host = host:gsub("/", " / ") }
end
end