mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-28 04:52:36 +02:00
remove NotifyWatchonlyChanged
The signal is never called.
This commit is contained in:
parent
fa62a013a5
commit
ffff949472
@ -303,10 +303,6 @@ public:
|
|||||||
using TransactionChangedFn = std::function<void(const uint256& txid, ChangeType status)>;
|
using TransactionChangedFn = std::function<void(const uint256& txid, ChangeType status)>;
|
||||||
virtual std::unique_ptr<Handler> handleTransactionChanged(TransactionChangedFn fn) = 0;
|
virtual std::unique_ptr<Handler> handleTransactionChanged(TransactionChangedFn fn) = 0;
|
||||||
|
|
||||||
//! Register handler for watchonly changed messages.
|
|
||||||
using WatchOnlyChangedFn = std::function<void(bool have_watch_only)>;
|
|
||||||
virtual std::unique_ptr<Handler> handleWatchOnlyChanged(WatchOnlyChangedFn fn) = 0;
|
|
||||||
|
|
||||||
//! Register handler for keypool changed messages.
|
//! Register handler for keypool changed messages.
|
||||||
using CanGetAddressesChangedFn = std::function<void()>;
|
using CanGetAddressesChangedFn = std::function<void()>;
|
||||||
virtual std::unique_ptr<Handler> handleCanGetAddressesChanged(CanGetAddressesChangedFn fn) = 0;
|
virtual std::unique_ptr<Handler> handleCanGetAddressesChanged(CanGetAddressesChangedFn fn) = 0;
|
||||||
|
@ -243,9 +243,6 @@ void TransactionView::setModel(WalletModel *_model)
|
|||||||
|
|
||||||
// hide column Watch-only
|
// hide column Watch-only
|
||||||
updateWatchOnlyColumn(false);
|
updateWatchOnlyColumn(false);
|
||||||
|
|
||||||
// Watch-only signal
|
|
||||||
connect(_model, &WalletModel::notifyWatchonlyChanged, this, &TransactionView::updateWatchOnlyColumn);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,6 @@ WalletModel::WalletModel(std::unique_ptr<interfaces::Wallet> wallet, ClientModel
|
|||||||
optionsModel(client_model.getOptionsModel()),
|
optionsModel(client_model.getOptionsModel()),
|
||||||
timer(new QTimer(this))
|
timer(new QTimer(this))
|
||||||
{
|
{
|
||||||
fHaveWatchOnly = false;
|
|
||||||
addressTableModel = new AddressTableModel(this);
|
addressTableModel = new AddressTableModel(this);
|
||||||
transactionTableModel = new TransactionTableModel(platformStyle, this);
|
transactionTableModel = new TransactionTableModel(platformStyle, this);
|
||||||
recentRequestsTableModel = new RecentRequestsTableModel(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);
|
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
|
bool WalletModel::validateAddress(const QString& address) const
|
||||||
{
|
{
|
||||||
return IsValidDestinationString(address.toStdString());
|
return IsValidDestinationString(address.toStdString());
|
||||||
@ -405,13 +398,6 @@ static void ShowProgress(WalletModel *walletmodel, const std::string &title, int
|
|||||||
assert(invoked);
|
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)
|
static void NotifyCanGetAddressesChanged(WalletModel* walletmodel)
|
||||||
{
|
{
|
||||||
bool invoked = QMetaObject::invokeMethod(walletmodel, "canGetAddressesChanged");
|
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_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_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_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));
|
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_address_book_changed->disconnect();
|
||||||
m_handler_transaction_changed->disconnect();
|
m_handler_transaction_changed->disconnect();
|
||||||
m_handler_show_progress->disconnect();
|
m_handler_show_progress->disconnect();
|
||||||
m_handler_watch_only_changed->disconnect();
|
|
||||||
m_handler_can_get_addrs_changed->disconnect();
|
m_handler_can_get_addrs_changed->disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,12 +162,10 @@ private:
|
|||||||
std::unique_ptr<interfaces::Handler> m_handler_address_book_changed;
|
std::unique_ptr<interfaces::Handler> m_handler_address_book_changed;
|
||||||
std::unique_ptr<interfaces::Handler> m_handler_transaction_changed;
|
std::unique_ptr<interfaces::Handler> m_handler_transaction_changed;
|
||||||
std::unique_ptr<interfaces::Handler> m_handler_show_progress;
|
std::unique_ptr<interfaces::Handler> m_handler_show_progress;
|
||||||
std::unique_ptr<interfaces::Handler> m_handler_watch_only_changed;
|
|
||||||
std::unique_ptr<interfaces::Handler> m_handler_can_get_addrs_changed;
|
std::unique_ptr<interfaces::Handler> m_handler_can_get_addrs_changed;
|
||||||
ClientModel* m_client_model;
|
ClientModel* m_client_model;
|
||||||
interfaces::Node& m_node;
|
interfaces::Node& m_node;
|
||||||
|
|
||||||
bool fHaveWatchOnly;
|
|
||||||
bool fForceCheckBalanceChanged{false};
|
bool fForceCheckBalanceChanged{false};
|
||||||
|
|
||||||
// Wallet has an options model for wallet-specific options
|
// Wallet has an options model for wallet-specific options
|
||||||
@ -211,9 +209,6 @@ Q_SIGNALS:
|
|||||||
// Show progress dialog e.g. for rescan
|
// Show progress dialog e.g. for rescan
|
||||||
void showProgress(const QString &title, int nProgress);
|
void showProgress(const QString &title, int nProgress);
|
||||||
|
|
||||||
// Watch-only address added
|
|
||||||
void notifyWatchonlyChanged(bool fHaveWatchonly);
|
|
||||||
|
|
||||||
// Signal that wallet is about to be removed
|
// Signal that wallet is about to be removed
|
||||||
void unload();
|
void unload();
|
||||||
|
|
||||||
@ -232,8 +227,6 @@ public Q_SLOTS:
|
|||||||
void updateTransaction();
|
void updateTransaction();
|
||||||
/* New, updated or removed address book entry */
|
/* New, updated or removed address book entry */
|
||||||
void updateAddressBook(const QString &address, const QString &label, bool isMine, wallet::AddressPurpose purpose, int status);
|
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 */
|
/* Current, immature or unconfirmed balance might have changed - emit 'balanceChanged' if so */
|
||||||
void pollBalanceChanged();
|
void pollBalanceChanged();
|
||||||
};
|
};
|
||||||
|
@ -535,10 +535,6 @@ public:
|
|||||||
return MakeSignalHandler(m_wallet->NotifyTransactionChanged.connect(
|
return MakeSignalHandler(m_wallet->NotifyTransactionChanged.connect(
|
||||||
[fn](const uint256& txid, ChangeType status) { fn(txid, status); }));
|
[fn](const uint256& txid, ChangeType status) { fn(txid, status); }));
|
||||||
}
|
}
|
||||||
std::unique_ptr<Handler> handleWatchOnlyChanged(WatchOnlyChangedFn fn) override
|
|
||||||
{
|
|
||||||
return MakeSignalHandler(m_wallet->NotifyWatchonlyChanged.connect(fn));
|
|
||||||
}
|
|
||||||
std::unique_ptr<Handler> handleCanGetAddressesChanged(CanGetAddressesChangedFn fn) override
|
std::unique_ptr<Handler> handleCanGetAddressesChanged(CanGetAddressesChangedFn fn) override
|
||||||
{
|
{
|
||||||
return MakeSignalHandler(m_wallet->NotifyCanGetAddressesChanged.connect(fn));
|
return MakeSignalHandler(m_wallet->NotifyCanGetAddressesChanged.connect(fn));
|
||||||
|
@ -167,9 +167,6 @@ public:
|
|||||||
LogInfo("%s %s", m_storage.GetDisplayName(), tfm::format(wallet_fmt, params...));
|
LogInfo("%s %s", m_storage.GetDisplayName(), tfm::format(wallet_fmt, params...));
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Watch-only address added */
|
|
||||||
boost::signals2::signal<void (bool fHaveWatchOnly)> NotifyWatchonlyChanged;
|
|
||||||
|
|
||||||
/** Keypool has new keys */
|
/** Keypool has new keys */
|
||||||
boost::signals2::signal<void ()> NotifyCanGetAddressesChanged;
|
boost::signals2::signal<void ()> NotifyCanGetAddressesChanged;
|
||||||
|
|
||||||
|
@ -3518,7 +3518,6 @@ bool CWallet::HaveCryptedKeys() const
|
|||||||
void CWallet::ConnectScriptPubKeyManNotifiers()
|
void CWallet::ConnectScriptPubKeyManNotifiers()
|
||||||
{
|
{
|
||||||
for (const auto& spk_man : GetActiveScriptPubKeyMans()) {
|
for (const auto& spk_man : GetActiveScriptPubKeyMans()) {
|
||||||
spk_man->NotifyWatchonlyChanged.connect(NotifyWatchonlyChanged);
|
|
||||||
spk_man->NotifyCanGetAddressesChanged.connect(NotifyCanGetAddressesChanged);
|
spk_man->NotifyCanGetAddressesChanged.connect(NotifyCanGetAddressesChanged);
|
||||||
spk_man->NotifyFirstKeyTimeChanged.connect(std::bind(&CWallet::MaybeUpdateBirthTime, this, std::placeholders::_2));
|
spk_man->NotifyFirstKeyTimeChanged.connect(std::bind(&CWallet::MaybeUpdateBirthTime, this, std::placeholders::_2));
|
||||||
}
|
}
|
||||||
|
@ -842,9 +842,6 @@ public:
|
|||||||
/** Show progress e.g. for rescan */
|
/** Show progress e.g. for rescan */
|
||||||
boost::signals2::signal<void (const std::string &title, int nProgress)> ShowProgress;
|
boost::signals2::signal<void (const std::string &title, int nProgress)> ShowProgress;
|
||||||
|
|
||||||
/** Watch-only address added */
|
|
||||||
boost::signals2::signal<void (bool fHaveWatchOnly)> NotifyWatchonlyChanged;
|
|
||||||
|
|
||||||
/** Keypool has new keys */
|
/** Keypool has new keys */
|
||||||
boost::signals2::signal<void ()> NotifyCanGetAddressesChanged;
|
boost::signals2::signal<void ()> NotifyCanGetAddressesChanged;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user