From daaba1dbc00eb8ee8a12726a311d5681d0b2b829 Mon Sep 17 00:00:00 2001 From: hagen Date: Mon, 11 Jan 2016 11:00:51 +0000 Subject: [PATCH] * prevent zero-division exception when running offline --- NetDb.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/NetDb.cpp b/NetDb.cpp index cc50bbc2..d0b6da26 100644 --- a/NetDb.cpp +++ b/NetDb.cpp @@ -126,6 +126,11 @@ namespace data if (ts - lastExploratory >= 30) // exploratory every 30 seconds { auto numRouters = m_RouterInfos.size (); + if (numRouters == 0) + { + LogPrint(eLogError, "NetDb: no known routers, reseed seems to be totally failed"); + break; + } if (numRouters < 2500 || ts - lastExploratory >= 90) { numRouters = 800/numRouters;