-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Seed random in Core Thread. Core Thread didn't seed random, resulting in always using the same bootstrap nodes, even when you restart qTox or change profiles. - Use QDateTime::currentMSecsSinceEpoch() for seeding random. It provides a bigger range of numbers than QTime::currentTime().msec() does, and the latter somehow managed to result in approximately the same first random number being generated, within a certain range. - Use something a it more sensible than a mod operation to bound random numbers within a range. It's not perfect either, but a lot better. Using mod on random skews its distribution too much. - Use QRandomGenerator's bounded() function to generate random values within a range. - Enable QRandomGenerator's usage starting with Qt 5.10.0. QRandomGenerator is present since Qt 5.10.0, not 5.15.0. - Bootstrap off every 5th node instead of two consecutive nodes. It's likely that two consecutive nodes will have the same owner, which makes some attacks more likely. The node selection algorithm should be scraped and redone from scratch to be honest though.
- Loading branch information
Showing
2 changed files
with
23 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters