mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Randomized the bootstrap table, to distribute load away from the first 5
This commit is contained in:
parent
809ae86898
commit
22375e3b8f
6
core.cpp
6
core.cpp
|
@ -108,6 +108,8 @@ void Core::start()
|
|||
return;
|
||||
}
|
||||
|
||||
qsrand(time(nullptr));
|
||||
|
||||
loadConfiguration();
|
||||
|
||||
tox_callback_friend_request(tox, onFriendRequest, this);
|
||||
|
@ -675,9 +677,9 @@ void Core::bootstrapDht()
|
|||
const Settings& s = Settings::getInstance();
|
||||
QList<Settings::DhtServer> dhtServerList = s.getDhtServerList();
|
||||
|
||||
static int j = 0;
|
||||
int i=0;
|
||||
int listSize = dhtServerList.size();
|
||||
static int j = qrand() % listSize;
|
||||
int i=0;
|
||||
while (i<5)
|
||||
{
|
||||
const Settings::DhtServer& dhtServer = dhtServerList[j % listSize];
|
||||
|
|
|
@ -48,6 +48,7 @@ SettingsForm::SettingsForm()
|
|||
useTranslations.setChecked(Settings::getInstance().getUseTranslations());
|
||||
makeToxPortable.setText(tr("Make Tox portable","Text on a checkbox to make qTox a portable application"));
|
||||
makeToxPortable.setChecked(Settings::getInstance().getMakeToxPortable());
|
||||
makeToxPortable.setToolTip(tr("Save settings to the working directory instead of the usual conf dir","describes makeToxPortable checkbox"));
|
||||
|
||||
main->setLayout(&layout);
|
||||
layout.addWidget(&nameLabel);
|
||||
|
|
Loading…
Reference in New Issue
Block a user