1212#include " qt/pivx/qtutils.h"
1313#include " qt/walletmodel.h"
1414
15- #include < QIntValidator >
15+ #include < QDoubleValidator >
1616#include < QRegularExpression>
1717#include < QGraphicsDropShadowEffect>
1818
@@ -176,7 +176,7 @@ void MasterNodeWizardDialog::initOperatorPage()
176176 initCssEditLine (ui->lineEditOperatorKey );
177177 initCssEditLine (ui->lineEditOperatorPayoutAddress );
178178 initCssEditLine (ui->lineEditPercentage );
179- ui->lineEditPercentage ->setValidator (new QIntValidator ( 1 , 99 ));
179+ ui->lineEditPercentage ->setValidator (new QDoubleValidator ( 0.00 , 100.00 , 2 , ui-> lineEditPercentage ));
180180}
181181
182182void MasterNodeWizardDialog::initVoterPage ()
@@ -454,7 +454,7 @@ bool MasterNodeWizardDialog::createMN()
454454 // 3) Get operator data
455455 QString operatorKey = ui->lineEditOperatorKey ->text ();
456456 Optional<CKeyID> operatorPayoutKeyId = walletModel->getKeyIDFromAddr (ui->lineEditOperatorPayoutAddress ->text ().toStdString ());
457- int operatorPercentage = ui->lineEditPercentage ->text ().isEmpty () ? 0 : (int ) ui->lineEditPercentage ->text ().toUInt ();
457+ double operatorPercentage = ui->lineEditPercentage ->text ().isEmpty () ? 0 : (int ) ui->lineEditPercentage ->text ().toDouble ();
458458
459459 // 4) Get voter data
460460 Optional<CKeyID> votingAddr;
@@ -481,7 +481,7 @@ bool MasterNodeWizardDialog::createMN()
481481 votingAddr,
482482 payoutKeyId,
483483 error_str,
484- operatorPercentage, // operator percentage
484+ ( uint16_t ) operatorPercentage * 10000 , // operator percentage
485485 operatorPayoutKeyId); // operator payout script
486486 if (!res) {
487487 return errorOut (tr (error_str.c_str ()));
0 commit comments