Skip to content

Commit ffff949

Browse files
author
MarcoFalke
committed
remove NotifyWatchonlyChanged
The signal is never called.
1 parent fa62a01 commit ffff949

File tree

8 files changed

+0
-41
lines changed

8 files changed

+0
-41
lines changed

src/interfaces/wallet.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,6 @@ class Wallet
303303
using TransactionChangedFn = std::function<void(const uint256& txid, ChangeType status)>;
304304
virtual std::unique_ptr<Handler> handleTransactionChanged(TransactionChangedFn fn) = 0;
305305

306-
//! Register handler for watchonly changed messages.
307-
using WatchOnlyChangedFn = std::function<void(bool have_watch_only)>;
308-
virtual std::unique_ptr<Handler> handleWatchOnlyChanged(WatchOnlyChangedFn fn) = 0;
309-
310306
//! Register handler for keypool changed messages.
311307
using CanGetAddressesChangedFn = std::function<void()>;
312308
virtual std::unique_ptr<Handler> handleCanGetAddressesChanged(CanGetAddressesChangedFn fn) = 0;

src/qt/transactionview.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,6 @@ void TransactionView::setModel(WalletModel *_model)
243243

244244
// hide column Watch-only
245245
updateWatchOnlyColumn(false);
246-
247-
// Watch-only signal
248-
connect(_model, &WalletModel::notifyWatchonlyChanged, this, &TransactionView::updateWatchOnlyColumn);
249246
}
250247
}
251248

src/qt/walletmodel.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ WalletModel::WalletModel(std::unique_ptr<interfaces::Wallet> wallet, ClientModel
4545
optionsModel(client_model.getOptionsModel()),
4646
timer(new QTimer(this))
4747
{
48-
fHaveWatchOnly = false;
4948
addressTableModel = new AddressTableModel(this);
5049
transactionTableModel = new TransactionTableModel(platformStyle, this);
5150
recentRequestsTableModel = new RecentRequestsTableModel(this);
@@ -141,12 +140,6 @@ void WalletModel::updateAddressBook(const QString &address, const QString &label
141140
addressTableModel->updateEntry(address, label, isMine, purpose, status);
142141
}
143142

144-
void WalletModel::updateWatchOnlyFlag(bool fHaveWatchonly)
145-
{
146-
fHaveWatchOnly = fHaveWatchonly;
147-
Q_EMIT notifyWatchonlyChanged(fHaveWatchonly);
148-
}
149-
150143
bool WalletModel::validateAddress(const QString& address) const
151144
{
152145
return IsValidDestinationString(address.toStdString());
@@ -405,13 +398,6 @@ static void ShowProgress(WalletModel *walletmodel, const std::string &title, int
405398
assert(invoked);
406399
}
407400

408-
static void NotifyWatchonlyChanged(WalletModel *walletmodel, bool fHaveWatchonly)
409-
{
410-
bool invoked = QMetaObject::invokeMethod(walletmodel, "updateWatchOnlyFlag", Qt::QueuedConnection,
411-
Q_ARG(bool, fHaveWatchonly));
412-
assert(invoked);
413-
}
414-
415401
static void NotifyCanGetAddressesChanged(WalletModel* walletmodel)
416402
{
417403
bool invoked = QMetaObject::invokeMethod(walletmodel, "canGetAddressesChanged");
@@ -426,7 +412,6 @@ void WalletModel::subscribeToCoreSignals()
426412
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));
427413
m_handler_transaction_changed = m_wallet->handleTransactionChanged(std::bind(NotifyTransactionChanged, this, std::placeholders::_1, std::placeholders::_2));
428414
m_handler_show_progress = m_wallet->handleShowProgress(std::bind(ShowProgress, this, std::placeholders::_1, std::placeholders::_2));
429-
m_handler_watch_only_changed = m_wallet->handleWatchOnlyChanged(std::bind(NotifyWatchonlyChanged, this, std::placeholders::_1));
430415
m_handler_can_get_addrs_changed = m_wallet->handleCanGetAddressesChanged(std::bind(NotifyCanGetAddressesChanged, this));
431416
}
432417

@@ -438,7 +423,6 @@ void WalletModel::unsubscribeFromCoreSignals()
438423
m_handler_address_book_changed->disconnect();
439424
m_handler_transaction_changed->disconnect();
440425
m_handler_show_progress->disconnect();
441-
m_handler_watch_only_changed->disconnect();
442426
m_handler_can_get_addrs_changed->disconnect();
443427
}
444428

src/qt/walletmodel.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,10 @@ class WalletModel : public QObject
162162
std::unique_ptr<interfaces::Handler> m_handler_address_book_changed;
163163
std::unique_ptr<interfaces::Handler> m_handler_transaction_changed;
164164
std::unique_ptr<interfaces::Handler> m_handler_show_progress;
165-
std::unique_ptr<interfaces::Handler> m_handler_watch_only_changed;
166165
std::unique_ptr<interfaces::Handler> m_handler_can_get_addrs_changed;
167166
ClientModel* m_client_model;
168167
interfaces::Node& m_node;
169168

170-
bool fHaveWatchOnly;
171169
bool fForceCheckBalanceChanged{false};
172170

173171
// Wallet has an options model for wallet-specific options
@@ -211,9 +209,6 @@ class WalletModel : public QObject
211209
// Show progress dialog e.g. for rescan
212210
void showProgress(const QString &title, int nProgress);
213211

214-
// Watch-only address added
215-
void notifyWatchonlyChanged(bool fHaveWatchonly);
216-
217212
// Signal that wallet is about to be removed
218213
void unload();
219214

@@ -232,8 +227,6 @@ public Q_SLOTS:
232227
void updateTransaction();
233228
/* New, updated or removed address book entry */
234229
void updateAddressBook(const QString &address, const QString &label, bool isMine, wallet::AddressPurpose purpose, int status);
235-
/* Watch-only added */
236-
void updateWatchOnlyFlag(bool fHaveWatchonly);
237230
/* Current, immature or unconfirmed balance might have changed - emit 'balanceChanged' if so */
238231
void pollBalanceChanged();
239232
};

src/wallet/interfaces.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -535,10 +535,6 @@ class WalletImpl : public Wallet
535535
return MakeSignalHandler(m_wallet->NotifyTransactionChanged.connect(
536536
[fn](const uint256& txid, ChangeType status) { fn(txid, status); }));
537537
}
538-
std::unique_ptr<Handler> handleWatchOnlyChanged(WatchOnlyChangedFn fn) override
539-
{
540-
return MakeSignalHandler(m_wallet->NotifyWatchonlyChanged.connect(fn));
541-
}
542538
std::unique_ptr<Handler> handleCanGetAddressesChanged(CanGetAddressesChangedFn fn) override
543539
{
544540
return MakeSignalHandler(m_wallet->NotifyCanGetAddressesChanged.connect(fn));

src/wallet/scriptpubkeyman.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,6 @@ class ScriptPubKeyMan
167167
LogInfo("%s %s", m_storage.GetDisplayName(), tfm::format(wallet_fmt, params...));
168168
};
169169

170-
/** Watch-only address added */
171-
boost::signals2::signal<void (bool fHaveWatchOnly)> NotifyWatchonlyChanged;
172-
173170
/** Keypool has new keys */
174171
boost::signals2::signal<void ()> NotifyCanGetAddressesChanged;
175172

src/wallet/wallet.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3518,7 +3518,6 @@ bool CWallet::HaveCryptedKeys() const
35183518
void CWallet::ConnectScriptPubKeyManNotifiers()
35193519
{
35203520
for (const auto& spk_man : GetActiveScriptPubKeyMans()) {
3521-
spk_man->NotifyWatchonlyChanged.connect(NotifyWatchonlyChanged);
35223521
spk_man->NotifyCanGetAddressesChanged.connect(NotifyCanGetAddressesChanged);
35233522
spk_man->NotifyFirstKeyTimeChanged.connect(std::bind(&CWallet::MaybeUpdateBirthTime, this, std::placeholders::_2));
35243523
}

src/wallet/wallet.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -842,9 +842,6 @@ class CWallet final : public WalletStorage, public interfaces::Chain::Notificati
842842
/** Show progress e.g. for rescan */
843843
boost::signals2::signal<void (const std::string &title, int nProgress)> ShowProgress;
844844

845-
/** Watch-only address added */
846-
boost::signals2::signal<void (bool fHaveWatchOnly)> NotifyWatchonlyChanged;
847-
848845
/** Keypool has new keys */
849846
boost::signals2::signal<void ()> NotifyCanGetAddressesChanged;
850847

0 commit comments

Comments
 (0)