aboutsummaryrefslogtreecommitdiff
path: root/src/p2p
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-01-20 20:59:09 -0500
committerRiccardo Spagni <ric@spagni.net>2017-01-20 20:59:09 -0500
commit3db3a6ee1aefc7de8b85e5f19c09f57c15c91fc7 (patch)
tree9dd054086a211ff065ea8cd4a5ace583b8fe9ad0 /src/p2p
parentMerge pull request #1592 (diff)
parentHonor depth in get_peerlist_head method (diff)
downloadmonero-3db3a6ee1aefc7de8b85e5f19c09f57c15c91fc7.tar.xz
Merge pull request #1593
cbcdf8ad Honor depth in get_peerlist_head method (Miguel Herranz)
Diffstat (limited to 'src/p2p')
-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;
}