aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/p2p/net_peerlist.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/p2p/net_peerlist.h b/src/p2p/net_peerlist.h
index fa69abd6e..db9387ceb 100644
--- a/src/p2p/net_peerlist.h
+++ b/src/p2p/net_peerlist.h
@@ -285,9 +285,11 @@ namespace nodetool
{
if(!vl.last_seen)
continue;
- bs_head.push_back(vl);
- if(cnt++ > depth)
+
+ if(cnt++ >= depth)
break;
+
+ bs_head.push_back(vl);
}
return true;
}