Browse Source

Address @diara 's comments about turnstile.

import_zecw
Aditya Kulkarni 6 years ago
parent
commit
b150f074f7
  1. 5
      src/main.cpp
  2. 1
      src/precompiled.h
  3. 5
      src/turnstile.cpp

5
src/main.cpp

@ -18,7 +18,10 @@ int main(int argc, char *argv[])
qApp->setFont(QFont("Ubuntu", 11, QFont::Normal, false));
#endif
std::srand(static_cast<unsigned int>(std::time(nullptr)));
// QRandomGenerator generates a secure random number, which we use to seed.
unsigned int seed = QRandomGenerator::securelySeeded().generate();
std::srand(seed);
Settings::init();
Settings::getInstance()->setExecName(argv[0]);

1
src/precompiled.h

@ -19,6 +19,7 @@
#include <QScrollBar>
#include <QPainter>
#include <QMovie>
#include <QRandomGenerator>
#include <QPair>
#include <QDir>
#include <QMenu>

5
src/turnstile.cpp

@ -183,8 +183,9 @@ void Turnstile::fillAmounts(QList<double>& amounts, double amount, int count) {
return;
}
// Get a random amount off the amount (between half and full) and call recursively.
// Multiply by hundred, because we'll operate on 0.01 ZEC minimum. We'll divide by 100 later
// Get a random amount off the total amount and call recursively.
// Multiply by hundred, because we'll operate on 0.01 ZEC minimum. We'll divide by 100 later on
// in this function.
double curAmount = std::rand() % (int)std::floor(amount * 100);
// Try to round it off

Loading…
Cancel
Save