summaryrefslogtreecommitdiffstats
path: root/PICA_node.c
diff options
context:
space:
mode:
Diffstat (limited to 'PICA_node.c')
-rw-r--r--PICA_node.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/PICA_node.c b/PICA_node.c
index a8810d4..574aa9b 100644
--- a/PICA_node.c
+++ b/PICA_node.c
@@ -2592,7 +2592,19 @@ int process_timeouts()
if (time(0) - skynet_refresh_tmst > SKYNET_REFRESH_TIMEOUT && !nodewait_list)
{
+ int clean_treshold = 100 - nodelink_list_count - cclink_list_count;
+
+ if (clean_treshold <= 0)
+ clean_treshold = 3;
+
PICA_debug3("refreshing nodelist database");
+
+ if (nodelink_list_count > 0)
+ {
+ PICA_debug3("trying to clean nodes unreachable after more than %i attempts", clean_treshold);
+ PICA_nodeaddr_cleanold(nodecfg.nodes_db_file, clean_treshold);
+ }
+
PICA_node_joinskynet(nodecfg.nodes_db_file, nodecfg.announced_addr);
}
return 1;