Skip to content

Commit

Permalink
[GUI] MasterNodeWizardDialog: fix RegTestNet default port 51476
Browse files Browse the repository at this point in the history
  • Loading branch information
random-zebra committed Mar 8, 2020
1 parent d4f69bf commit 22a9a7a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/qt/pivx/masternodeswidget.cpp
Expand Up @@ -205,7 +205,7 @@ bool MasterNodesWidget::checkMNsNetwork()
void MasterNodesWidget::onEditMNClicked()
{
if(walletModel) {
if (!Params().IsRegTestNet() && !checkMNsNetwork()) return; // skip on RegNet: so we can test even if tier two not synced
if (!walletModel->isRegTestNetwork() && !checkMNsNetwork()) return;
if (index.sibling(index.row(), MNModel::WAS_COLLATERAL_ACCEPTED).data(Qt::DisplayRole).toBool()) {
// Start MN
QString strAlias = this->index.data(Qt::DisplayRole).toString();
Expand Down
5 changes: 4 additions & 1 deletion src/qt/pivx/masternodewizarddialog.cpp
Expand Up @@ -64,7 +64,10 @@ MasterNodeWizardDialog::MasterNodeWizardDialog(WalletModel *model, QWidget *pare
initCssEditLine(ui->lineEditPort);
ui->stackedWidget->setCurrentIndex(pos);
ui->lineEditPort->setValidator(new QIntValidator(0, 9999999, ui->lineEditPort));
if(walletModel->isTestNetwork()){
if (walletModel->isRegTestNetwork()) {
ui->lineEditPort->setEnabled(false);
ui->lineEditPort->setText("51476");
} else if (walletModel->isTestNetwork()) {
ui->lineEditPort->setEnabled(false);
ui->lineEditPort->setText("51474");
} else {
Expand Down
10 changes: 8 additions & 2 deletions src/qt/walletmodel.cpp
Expand Up @@ -58,8 +58,14 @@ WalletModel::~WalletModel()
unsubscribeFromCoreSignals();
}

bool WalletModel::isTestNetwork() const {
return Params().NetworkID() == CBaseChainParams::TESTNET || Params().IsRegTestNet();
bool WalletModel::isTestNetwork() const
{
return Params().NetworkID() == CBaseChainParams::TESTNET;
}

bool WalletModel::isRegTestNetwork() const
{
return Params().IsRegTestNet();
}

bool WalletModel::isColdStakingNetworkelyEnabled() const {
Expand Down
1 change: 1 addition & 0 deletions src/qt/walletmodel.h
Expand Up @@ -142,6 +142,7 @@ class WalletModel : public QObject
RecentRequestsTableModel* getRecentRequestsTableModel();

bool isTestNetwork() const;
bool isRegTestNetwork() const;
/** Whether cold staking is enabled or disabled in the network **/
bool isColdStakingNetworkelyEnabled() const;
CAmount getMinColdStakingAmount() const;
Expand Down

0 comments on commit 22a9a7a

Please sign in to comment.