File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -250,21 +250,18 @@ void MasternodeList::updateDIP3List()
250250
251251 // Update filters
252252 if (walletModel && ui->checkBoxOwned ->isChecked ()) {
253- updateMyMasternodeHashes ();
253+ updateMyMasternodeHashes (mnList );
254254 }
255255
256256 updateFilteredCount ();
257257}
258258
259- void MasternodeList::updateMyMasternodeHashes ()
259+ void MasternodeList::updateMyMasternodeHashes (const interfaces::MnListPtr& mnList )
260260{
261- if (!clientModel || !walletModel ) {
261+ if (!walletModel || !mnList ) {
262262 return ;
263263 }
264264
265- auto [mnList, pindex] = clientModel->getMasternodeList ();
266- if (!pindex) return ;
267-
268265 std::set<COutPoint> setOutpts;
269266 for (const auto & outpt : walletModel->wallet ().listProTxCoins ()) {
270267 setOutpts.emplace (outpt);
@@ -313,8 +310,11 @@ void MasternodeList::on_comboBoxType_currentIndexChanged(int index)
313310void MasternodeList::on_checkBoxOwned_stateChanged (int state)
314311{
315312 m_proxy_model->setShowOwnedOnly (state == Qt::Checked);
316- if (state == Qt::Checked) {
317- updateMyMasternodeHashes ();
313+ if (clientModel && state == Qt::Checked) {
314+ auto [mnList, pindex] = clientModel->getMasternodeList ();
315+ if (mnList) {
316+ updateMyMasternodeHashes (mnList);
317+ }
318318 } else {
319319 m_proxy_model->forceInvalidateFilter ();
320320 }
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
@@ -89,7 +94,7 @@ class MasternodeList : public QWidget
8994 const MasternodeEntry* GetSelectedEntry ();
9095
9196 void updateDIP3List ();
92- void updateMyMasternodeHashes ();
97+ void updateMyMasternodeHashes (const interfaces::MnListPtr& mnList );
9398
9499Q_SIGNALS:
95100 void doubleClicked (const QModelIndex&);
You can’t perform that action at this time.
0 commit comments