From 0126f6f2c65872cbe5608530acfcb65050c432dc Mon Sep 17 00:00:00 2001 From: arvidn Date: Sat, 30 Jul 2016 00:38:17 -0400 Subject: [PATCH] fix timestamp arithmetic overflow --- src/kademlia/routing_table.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kademlia/routing_table.cpp b/src/kademlia/routing_table.cpp index f236b2ff8..dcb2a4ff2 100644 --- a/src/kademlia/routing_table.cpp +++ b/src/kademlia/routing_table.cpp @@ -727,7 +727,7 @@ routing_table::add_node_status_t routing_table::add_node_impl(node_entry e) auto now = aux::time_now(); for (auto& node : existing_bucket->live_nodes) { - if (now - node.last_queried > minutes(5)) + if (node.last_queried + minutes(5) < now) node.last_queried = min_time(); }