Merge pull request #162 from thomas-yuan/bootstrap

Only re-bootstrap when there is no enough nodes in routing table.
This commit is contained in:
Arvid Norberg 2015-09-20 14:52:16 -04:00
commit 6bf1971452
1 changed files with 3 additions and 1 deletions

View File

@ -508,8 +508,10 @@ void node::tick()
{
// every now and then we refresh our own ID, just to keep
// expanding the routing table buckets closer to us.
// if m_table.depth() < 4, means routing_table doesn't
// have enough nodes.
time_point now = aux::time_now();
if (m_last_self_refresh + minutes(10) < now)
if (m_last_self_refresh + minutes(10) < now && m_table.depth() < 4)
{
node_id target = m_id;
make_id_secret(target);