diff --git a/src/interfaces/wallet.h b/src/interfaces/wallet.h index 48d68c4e6b6..9fc8ab0ef51 100644 --- a/src/interfaces/wallet.h +++ b/src/interfaces/wallet.h @@ -303,10 +303,6 @@ public: using TransactionChangedFn = std::function; virtual std::unique_ptr handleTransactionChanged(TransactionChangedFn fn) = 0; - //! Register handler for watchonly changed messages. - using WatchOnlyChangedFn = std::function; - virtual std::unique_ptr handleWatchOnlyChanged(WatchOnlyChangedFn fn) = 0; - //! Register handler for keypool changed messages. using CanGetAddressesChangedFn = std::function; virtual std::unique_ptr handleCanGetAddressesChanged(CanGetAddressesChangedFn fn) = 0; diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index b4a60b427e1..1870f655420 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -243,9 +243,6 @@ void TransactionView::setModel(WalletModel *_model) // hide column Watch-only updateWatchOnlyColumn(false); - - // Watch-only signal - connect(_model, &WalletModel::notifyWatchonlyChanged, this, &TransactionView::updateWatchOnlyColumn); } } diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 455f9f469ed..07d5b9413c3 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -45,7 +45,6 @@ WalletModel::WalletModel(std::unique_ptr wallet, ClientModel optionsModel(client_model.getOptionsModel()), timer(new QTimer(this)) { - fHaveWatchOnly = false; addressTableModel = new AddressTableModel(this); transactionTableModel = new TransactionTableModel(platformStyle, this); recentRequestsTableModel = new RecentRequestsTableModel(this); @@ -141,12 +140,6 @@ void WalletModel::updateAddressBook(const QString &address, const QString &label addressTableModel->updateEntry(address, label, isMine, purpose, status); } -void WalletModel::updateWatchOnlyFlag(bool fHaveWatchonly) -{ - fHaveWatchOnly = fHaveWatchonly; - Q_EMIT notifyWatchonlyChanged(fHaveWatchonly); -} - bool WalletModel::validateAddress(const QString& address) const { return IsValidDestinationString(address.toStdString()); @@ -405,13 +398,6 @@ static void ShowProgress(WalletModel *walletmodel, const std::string &title, int assert(invoked); } -static void NotifyWatchonlyChanged(WalletModel *walletmodel, bool fHaveWatchonly) -{ - bool invoked = QMetaObject::invokeMethod(walletmodel, "updateWatchOnlyFlag", Qt::QueuedConnection, - Q_ARG(bool, fHaveWatchonly)); - assert(invoked); -} - static void NotifyCanGetAddressesChanged(WalletModel* walletmodel) { bool invoked = QMetaObject::invokeMethod(walletmodel, "canGetAddressesChanged"); @@ -426,7 +412,6 @@ void WalletModel::subscribeToCoreSignals() m_handler_address_book_changed = m_wallet->handleAddressBookChanged(std::bind(NotifyAddressBookChanged, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5)); m_handler_transaction_changed = m_wallet->handleTransactionChanged(std::bind(NotifyTransactionChanged, this, std::placeholders::_1, std::placeholders::_2)); m_handler_show_progress = m_wallet->handleShowProgress(std::bind(ShowProgress, this, std::placeholders::_1, std::placeholders::_2)); - m_handler_watch_only_changed = m_wallet->handleWatchOnlyChanged(std::bind(NotifyWatchonlyChanged, this, std::placeholders::_1)); m_handler_can_get_addrs_changed = m_wallet->handleCanGetAddressesChanged(std::bind(NotifyCanGetAddressesChanged, this)); } @@ -438,7 +423,6 @@ void WalletModel::unsubscribeFromCoreSignals() m_handler_address_book_changed->disconnect(); m_handler_transaction_changed->disconnect(); m_handler_show_progress->disconnect(); - m_handler_watch_only_changed->disconnect(); m_handler_can_get_addrs_changed->disconnect(); } diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index ab2096c1fef..8b849645f16 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -162,12 +162,10 @@ private: std::unique_ptr m_handler_address_book_changed; std::unique_ptr m_handler_transaction_changed; std::unique_ptr m_handler_show_progress; - std::unique_ptr m_handler_watch_only_changed; std::unique_ptr m_handler_can_get_addrs_changed; ClientModel* m_client_model; interfaces::Node& m_node; - bool fHaveWatchOnly; bool fForceCheckBalanceChanged{false}; // Wallet has an options model for wallet-specific options @@ -211,9 +209,6 @@ Q_SIGNALS: // Show progress dialog e.g. for rescan void showProgress(const QString &title, int nProgress); - // Watch-only address added - void notifyWatchonlyChanged(bool fHaveWatchonly); - // Signal that wallet is about to be removed void unload(); @@ -232,8 +227,6 @@ public Q_SLOTS: void updateTransaction(); /* New, updated or removed address book entry */ void updateAddressBook(const QString &address, const QString &label, bool isMine, wallet::AddressPurpose purpose, int status); - /* Watch-only added */ - void updateWatchOnlyFlag(bool fHaveWatchonly); /* Current, immature or unconfirmed balance might have changed - emit 'balanceChanged' if so */ void pollBalanceChanged(); }; diff --git a/src/wallet/interfaces.cpp b/src/wallet/interfaces.cpp index c3478455ec7..5308b4418d7 100644 --- a/src/wallet/interfaces.cpp +++ b/src/wallet/interfaces.cpp @@ -535,10 +535,6 @@ public: return MakeSignalHandler(m_wallet->NotifyTransactionChanged.connect( [fn](const uint256& txid, ChangeType status) { fn(txid, status); })); } - std::unique_ptr handleWatchOnlyChanged(WatchOnlyChangedFn fn) override - { - return MakeSignalHandler(m_wallet->NotifyWatchonlyChanged.connect(fn)); - } std::unique_ptr handleCanGetAddressesChanged(CanGetAddressesChangedFn fn) override { return MakeSignalHandler(m_wallet->NotifyCanGetAddressesChanged.connect(fn)); diff --git a/src/wallet/scriptpubkeyman.h b/src/wallet/scriptpubkeyman.h index 777731d0d8e..7fd81d80f4d 100644 --- a/src/wallet/scriptpubkeyman.h +++ b/src/wallet/scriptpubkeyman.h @@ -167,9 +167,6 @@ public: LogInfo("%s %s", m_storage.GetDisplayName(), tfm::format(wallet_fmt, params...)); }; - /** Watch-only address added */ - boost::signals2::signal NotifyWatchonlyChanged; - /** Keypool has new keys */ boost::signals2::signal NotifyCanGetAddressesChanged; diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 86d1cbdf306..3c5df177679 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3518,7 +3518,6 @@ bool CWallet::HaveCryptedKeys() const void CWallet::ConnectScriptPubKeyManNotifiers() { for (const auto& spk_man : GetActiveScriptPubKeyMans()) { - spk_man->NotifyWatchonlyChanged.connect(NotifyWatchonlyChanged); spk_man->NotifyCanGetAddressesChanged.connect(NotifyCanGetAddressesChanged); spk_man->NotifyFirstKeyTimeChanged.connect(std::bind(&CWallet::MaybeUpdateBirthTime, this, std::placeholders::_2)); } diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index a3800e72901..e32b8c7272b 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -842,9 +842,6 @@ public: /** Show progress e.g. for rescan */ boost::signals2::signal ShowProgress; - /** Watch-only address added */ - boost::signals2::signal NotifyWatchonlyChanged; - /** Keypool has new keys */ boost::signals2::signal NotifyCanGetAddressesChanged;