diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-01-20 20:59:09 -0500 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-01-20 20:59:09 -0500 |
commit | 3db3a6ee1aefc7de8b85e5f19c09f57c15c91fc7 (patch) | |
tree | 9dd054086a211ff065ea8cd4a5ace583b8fe9ad0 /src/p2p | |
parent | Merge pull request #1592 (diff) | |
parent | Honor depth in get_peerlist_head method (diff) | |
download | monero-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.h | 6 |
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; } |