File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -256,21 +256,18 @@ void MasternodeList::updateDIP3List()
256256
257257 // Update filters
258258 if (walletModel && ui->checkBoxOwned ->isChecked ()) {
259- updateMyMasternodeHashes ();
259+ updateMyMasternodeHashes (mnList );
260260 }
261261
262262 updateFilteredCount ();
263263}
264264
265- void MasternodeList::updateMyMasternodeHashes ()
265+ void MasternodeList::updateMyMasternodeHashes (const interfaces::MnListPtr& mnList )
266266{
267- if (!clientModel || !walletModel ) {
267+ if (!walletModel || !mnList ) {
268268 return ;
269269 }
270270
271- auto [mnList, pindex] = clientModel->getMasternodeList ();
272- if (!pindex) return ;
273-
274271 std::set<COutPoint> setOutpts;
275272 for (const auto & outpt : walletModel->wallet ().listProTxCoins ()) {
276273 setOutpts.emplace (outpt);
@@ -319,8 +316,11 @@ void MasternodeList::on_comboBoxType_currentIndexChanged(int index)
319316void MasternodeList::on_checkBoxOwned_stateChanged (int state)
320317{
321318 m_proxy_model->setShowOwnedOnly (state == Qt::Checked);
322- if (state == Qt::Checked) {
323- updateMyMasternodeHashes ();
319+ if (clientModel && state == Qt::Checked) {
320+ auto [mnList, pindex] = clientModel->getMasternodeList ();
321+ if (mnList) {
322+ updateMyMasternodeHashes (mnList);
323+ }
324324 } else {
325325 m_proxy_model->forceInvalidateFilter ();
326326 }
Original file line number Diff line number Diff line change 1414#include < QWidget>
1515
1616#include < atomic>
17+ #include < memory>
1718#include < set>
1819
20+ namespace interfaces {
21+ class MnList ;
22+ using MnListPtr = std::shared_ptr<MnList>;
23+ } // namespace interfaces
1924namespace Ui {
2025class MasternodeList ;
2126} // namespace Ui
@@ -92,7 +97,7 @@ class MasternodeList : public QWidget
9297 const MasternodeEntry* GetSelectedEntry ();
9398
9499 void updateDIP3List ();
95- void updateMyMasternodeHashes ();
100+ void updateMyMasternodeHashes (const interfaces::MnListPtr& mnList );
96101
97102Q_SIGNALS:
98103 void doubleClicked (const QModelIndex&);
You can’t perform that action at this time.
0 commit comments