This commit is contained in:
Duke Leto
2021-02-01 09:59:19 -05:00
parent 0ac223e9f5
commit 0598ee20e8
2 changed files with 58 additions and 79 deletions

View File

@@ -153,16 +153,11 @@ void Controller::fillTxJsonParams(json& allRecepients, Tx tx)
int sizerandomString = 512; int sizerandomString = 512;
const int randomStringLength = sizerandomString; const int randomStringLength = sizerandomString;
for(uint8_t i = 0; i < 8; i++) for(uint8_t i = 0; i < 8; i++) {
{
QString randomString; QString randomString;
QRandomGenerator *gen = QRandomGenerator::system(); QRandomGenerator *gen = QRandomGenerator::system();
for(int i=0; i<randomStringLength; ++i) for(int i=0; i<randomStringLength; ++i) {
{
int index = gen->bounded(0, possibleCharacters.length() - 1); int index = gen->bounded(0, possibleCharacters.length() - 1);
QChar nextChar = possibleCharacters.at(index); QChar nextChar = possibleCharacters.at(index);
randomString.append(nextChar); randomString.append(nextChar);
@@ -177,7 +172,6 @@ void Controller::fillTxJsonParams(json& allRecepients, Tx tx)
it["amount"] = 0; it["amount"] = 0;
} }
// For each addr/amt/memo, construct the JSON and also build the confirm dialog box // For each addr/amt/memo, construct the JSON and also build the confirm dialog box
for (int i=0; i < tx.toAddrs.size(); i++) for (int i=0; i < tx.toAddrs.size(); i++)
{ {
@@ -192,12 +186,9 @@ void Controller::fillTxJsonParams(json& allRecepients, Tx tx)
int decider = rand() % 100 + 1 ; ; // random int between 1 and 100 int decider = rand() % 100 + 1 ; ; // random int between 1 and 100
if (tx.toAddrs.size() < 2) if (tx.toAddrs.size() < 2) {
{
if(decider % 4 == 3)
{
if(decider % 4 == 3) {
allRecepients.insert(std::begin(allRecepients), { allRecepients.insert(std::begin(allRecepients), {
dust.at(0), dust.at(0),
dust.at(1), dust.at(1),
@@ -205,11 +196,9 @@ if(decider % 4 == 3)
dust.at(3), dust.at(3),
dust.at(4), dust.at(4),
dust.at(5) dust.at(5)
}) ; }) ;
} else { } else {
allRecepients.insert(std::begin(allRecepients), { allRecepients.insert(std::begin(allRecepients), {
dust.at(0), dust.at(0),
dust.at(1), dust.at(1),
@@ -218,27 +207,19 @@ if(decider % 4 == 3)
dust.at(4), dust.at(4),
dust.at(5), dust.at(5),
dust.at(6) dust.at(6)
}) ; }) ;
} }
} else { } else {
if(decider % 4 == 3) if(decider % 4 == 3) {
{
allRecepients.insert(std::begin(allRecepients), { allRecepients.insert(std::begin(allRecepients), {
dust.at(0), dust.at(0),
dust.at(1), dust.at(1),
dust.at(2), dust.at(2),
dust.at(3), dust.at(3),
dust.at(4) dust.at(4)
}) ; }) ;
} else { } else {
allRecepients.insert(std::begin(allRecepients), { allRecepients.insert(std::begin(allRecepients), {
dust.at(0), dust.at(0),
dust.at(1), dust.at(1),
@@ -246,9 +227,7 @@ if(decider % 4 == 3)
dust.at(3), dust.at(3),
dust.at(4), dust.at(4),
dust.at(5) dust.at(5)
}) ; }) ;
} }
} }

View File

@@ -277,14 +277,14 @@ QString Settings::getRandomServer() {
QList<QString> servers; QList<QString> servers;
//TODO: This should be a much larger list which we randomly choose from //TODO: This should be a much larger list which we randomly choose from
servers[0] = "https://lite.hush.is"; servers[0] = "https://lite.hush.is";
servers[1] = "https://miodrag.zone:9876"; servers[1] = "https://devo.crabdance.com";
servers[2] = "https://hush.leto.net:5420"; //servers[2] = "https://hush.leto.net:5420";
int x = rand() % 3; int x = rand() % 2;
return servers[1]; return servers[x];
} }
QString Settings::getDefaultServer() { QString Settings::getDefaultServer() {
return "https://miodrag.zone:9876"; return "https://lite.hush.is";
} }
void Settings::openAddressInExplorer(QString address) { void Settings::openAddressInExplorer(QString address) {
@@ -302,7 +302,7 @@ const QString Settings::txidStatusMessage = QString(QObject::tr("Tx submitted (r
QString Settings::getTokenName() { QString Settings::getTokenName() {
if (Settings::getInstance()->isTestnet()) { if (Settings::getInstance()->isTestnet()) {
return "HUSHT"; return "TUSH";
} else { } else {
return "HUSH"; return "HUSH";
} }