refactor: remove fMasternodeMode and fDisableGovernance from Qt code

This commit is contained in:
Kittywhiskers Van Gogh 2024-04-18 19:11:16 +00:00
parent 9402ce7171
commit b1527599e4
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD
4 changed files with 17 additions and 2 deletions

View File

@ -65,6 +65,7 @@ public:
virtual void getAllNewerThan(std::vector<CGovernanceObject> &objs, int64_t nMoreThanTime) = 0;
virtual int32_t getObjAbsYesCount(const CGovernanceObject& obj, vote_signal_enum_t vote_signal) = 0;
virtual bool getObjLocalValidity(const CGovernanceObject& obj, std::string& error, bool check_collateral) = 0;
virtual bool isEnabled() = 0;
virtual void setContext(NodeContext* context) {}
};
@ -230,6 +231,9 @@ public:
//! Is initial block download.
virtual bool isInitialBlockDownload() = 0;
//! Is masternode.
virtual bool isMasternode() = 0;
//! Get reindex.
virtual bool getReindex() = 0;

View File

@ -133,6 +133,13 @@ public:
}
return false;
}
bool isEnabled() override
{
if (context().govman != nullptr) {
return context().govman->IsValid();
}
return false;
}
void setContext(NodeContext* context) override
{
m_context = context;
@ -477,6 +484,10 @@ public:
}
return active_chainstate->IsInitialBlockDownload();
}
bool isMasternode() override
{
return m_context->mn_activeman != nullptr;
}
bool getReindex() override { return ::fReindex; }
bool getImporting() override { return ::fImporting; }
void setNetworkActive(bool active) override

View File

@ -1483,7 +1483,7 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, const QStri
tooltip += tr("Last received block was generated %1 ago.").arg(timeBehindText);
tooltip += QString("<br>");
tooltip += tr("Transactions after this will not yet be visible.");
} else if (fDisableGovernance) {
} else if (!m_node.gov().isEnabled()) {
setAdditionalDataSyncProgress(1);
}

View File

@ -474,7 +474,7 @@ void OverviewPage::coinJoinStatus(bool fForce)
if (!fForce && (clientModel->node().shutdownRequested() || !clientModel->masternodeSync().isBlockchainSynced())) return;
// Disable any PS UI for masternode or when autobackup is disabled or failed for whatever reason
if (fMasternodeMode || nWalletBackups <= 0) {
if (clientModel->node().isMasternode() || nWalletBackups <= 0) {
DisableCoinJoinCompletely();
if (nWalletBackups <= 0) {
ui->labelCoinJoinEnabled->setToolTip(tr("Automatic backups are disabled, no mixing available!"));