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 | |
| parent | 4bcd284c764ac35cd6352fc92b4bc2f75afbc793 (diff) | |
| parent | cbcdf8ad35a0404141ba08350449647449abd0c0 (diff) | |
| download | monzero-core-3db3a6ee1aefc7de8b85e5f19c09f57c15c91fc7.tar.gz monzero-core-3db3a6ee1aefc7de8b85e5f19c09f57c15c91fc7.tar.xz monzero-core-3db3a6ee1aefc7de8b85e5f19c09f57c15c91fc7.zip | |
Merge pull request #1593
cbcdf8ad Honor depth in get_peerlist_head method (Miguel Herranz)
| -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; } |
