Skip to content

Commit

Permalink
don't connect to too many peers at once
Browse files Browse the repository at this point in the history
hardcoded for now at 50 peers per calls to `getPeersToConnectTo`
  • Loading branch information
MonsieurNicolas committed Mar 16, 2018
1 parent 393eb97 commit 899d7bc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/overlay/OverlayManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,11 @@ OverlayManagerImpl::getPreferredPeersFromConfig()
std::vector<PeerRecord>
OverlayManagerImpl::getPeersToConnectTo(int maxNum)
{
const int batchSize = std::max(20, maxNum);
// don't connect to too many peers at once
maxNum = std::min(maxNum, 50);

// batch is how many peers to load from the database every time
const int batchSize = std::max(50, maxNum);

std::vector<PeerRecord> peers;

Expand Down

9 comments on commit 899d7bc

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from vogel
at MonsieurNicolas@899d7bc

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging MonsieurNicolas/stellar-core/peerFix = 899d7bc into auto

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MonsieurNicolas/stellar-core/peerFix = 899d7bc merged ok, testing candidate = ceb01c2d

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from vogel
at MonsieurNicolas@899d7bc

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging MonsieurNicolas/stellar-core/peerFix = 899d7bc into auto

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MonsieurNicolas/stellar-core/peerFix = 899d7bc merged ok, testing candidate = b0923f1

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = b0923f1

Please sign in to comment.