Skip to content

Commit 2be6f7b

Browse files
committed
[GUI] MasterNodeWizardDialog: fix RegTestNet default port 51476
1 parent 68a92f9 commit 2be6f7b

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

src/qt/pivx/masternodeswidget.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ bool MasterNodesWidget::checkMNsNetwork()
207207

208208
void MasterNodesWidget::onEditMNClicked()
209209
{
210-
if (walletModel) {
211-
if (!Params().IsRegTestNet() && !checkMNsNetwork()) return; // skip on RegNet: so we can test even if tier two not synced
210+
if(walletModel) {
211+
if (!walletModel->isRegTestNetwork() && !checkMNsNetwork()) return;
212212
if (index.sibling(index.row(), MNModel::WAS_COLLATERAL_ACCEPTED).data(Qt::DisplayRole).toBool()) {
213213
// Start MN
214214
QString strAlias = this->index.data(Qt::DisplayRole).toString();

src/qt/pivx/masternodewizarddialog.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ MasterNodeWizardDialog::MasterNodeWizardDialog(WalletModel *model, QWidget *pare
6363
initCssEditLine(ui->lineEditPort);
6464
ui->stackedWidget->setCurrentIndex(pos);
6565
ui->lineEditPort->setValidator(new QIntValidator(0, 9999999, ui->lineEditPort));
66-
if (walletModel->isTestNetwork()) {
66+
if (walletModel->isRegTestNetwork()) {
67+
ui->lineEditPort->setEnabled(false);
68+
ui->lineEditPort->setText("51476");
69+
} else if (walletModel->isTestNetwork()) {
6770
ui->lineEditPort->setEnabled(false);
6871
ui->lineEditPort->setText("51474");
6972
} else {

src/qt/walletmodel.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,14 @@ WalletModel::~WalletModel()
5858
unsubscribeFromCoreSignals();
5959
}
6060

61-
bool WalletModel::isTestNetwork() const {
62-
return Params().NetworkID() == CBaseChainParams::TESTNET || Params().IsRegTestNet();
61+
bool WalletModel::isTestNetwork() const
62+
{
63+
return Params().NetworkID() == CBaseChainParams::TESTNET;
64+
}
65+
66+
bool WalletModel::isRegTestNetwork() const
67+
{
68+
return Params().IsRegTestNet();
6369
}
6470

6571
bool WalletModel::isColdStakingNetworkelyEnabled() const {

src/qt/walletmodel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ class WalletModel : public QObject
142142
RecentRequestsTableModel* getRecentRequestsTableModel();
143143

144144
bool isTestNetwork() const;
145+
bool isRegTestNetwork() const;
145146
/** Whether cold staking is enabled or disabled in the network **/
146147
bool isColdStakingNetworkelyEnabled() const;
147148
CAmount getMinColdStakingAmount() const;

0 commit comments

Comments
 (0)