Skip to content

Commit faf3640

Browse files
author
MarcoFalke
committed
Remove unused wallet pointer from NotifyTransactionChanged signal
1 parent 8cdf917 commit faf3640

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

src/qt/test/wallettests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ uint256 SendCoins(CWallet& wallet, SendCoinsDialog& sendCoinsDialog, const CTxDe
6969
->findChild<QCheckBox*>("optInRBF")
7070
->setCheckState(rbf ? Qt::Checked : Qt::Unchecked);
7171
uint256 txid;
72-
boost::signals2::scoped_connection c(wallet.NotifyTransactionChanged.connect([&txid](CWallet*, const uint256& hash, ChangeType status) {
72+
boost::signals2::scoped_connection c(wallet.NotifyTransactionChanged.connect([&txid](const uint256& hash, ChangeType status) {
7373
if (status == CT_NEW) txid = hash;
7474
}));
7575
ConfirmSend();

src/wallet/interfaces.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ class WalletImpl : public Wallet
481481
std::unique_ptr<Handler> handleTransactionChanged(TransactionChangedFn fn) override
482482
{
483483
return MakeHandler(m_wallet->NotifyTransactionChanged.connect(
484-
[fn](CWallet*, const uint256& txid, ChangeType status) { fn(txid, status); }));
484+
[fn](const uint256& txid, ChangeType status) { fn(txid, status); }));
485485
}
486486
std::unique_ptr<Handler> handleWatchOnlyChanged(WatchOnlyChangedFn fn) override
487487
{

src/wallet/wallet.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ bool CWallet::MarkReplaced(const uint256& originalHash, const uint256& newHash)
801801
success = false;
802802
}
803803

804-
NotifyTransactionChanged(this, originalHash, CT_UPDATED);
804+
NotifyTransactionChanged(originalHash, CT_UPDATED);
805805

806806
return success;
807807
}
@@ -930,7 +930,7 @@ CWalletTx* CWallet::AddToWallet(CTransactionRef tx, const CWalletTx::Confirmatio
930930
wtx.MarkDirty();
931931

932932
// Notify UI of new or updated transaction
933-
NotifyTransactionChanged(this, hash, fInsertedNew ? CT_NEW : CT_UPDATED);
933+
NotifyTransactionChanged(hash, fInsertedNew ? CT_NEW : CT_UPDATED);
934934

935935
#if HAVE_SYSTEM
936936
// notify an external script when a wallet transaction comes in or is updated
@@ -1104,7 +1104,7 @@ bool CWallet::AbandonTransaction(const uint256& hashTx)
11041104
wtx.setAbandoned();
11051105
wtx.MarkDirty();
11061106
batch.WriteTx(wtx);
1107-
NotifyTransactionChanged(this, wtx.GetHash(), CT_UPDATED);
1107+
NotifyTransactionChanged(wtx.GetHash(), CT_UPDATED);
11081108
// Iterate over all its outputs, and mark transactions in the wallet that spend them abandoned too
11091109
TxSpends::const_iterator iter = mapTxSpends.lower_bound(COutPoint(now, 0));
11101110
while (iter != mapTxSpends.end() && iter->first.hash == now) {
@@ -1944,7 +1944,7 @@ void CWallet::CommitTransaction(CTransactionRef tx, mapValue_t mapValue, std::ve
19441944
for (const CTxIn& txin : tx->vin) {
19451945
CWalletTx &coin = mapWallet.at(txin.prevout.hash);
19461946
coin.MarkDirty();
1947-
NotifyTransactionChanged(this, coin.GetHash(), CT_UPDATED);
1947+
NotifyTransactionChanged(coin.GetHash(), CT_UPDATED);
19481948
}
19491949

19501950
// Get the inserted-CWalletTx from mapWallet so that the
@@ -1999,7 +1999,7 @@ DBErrors CWallet::ZapSelectTx(std::vector<uint256>& vHashIn, std::vector<uint256
19991999
for (const auto& txin : it->second.tx->vin)
20002000
mapTxSpends.erase(txin.prevout);
20012001
mapWallet.erase(it);
2002-
NotifyTransactionChanged(this, hash, CT_DELETED);
2002+
NotifyTransactionChanged(hash, CT_DELETED);
20032003
}
20042004

20052005
if (nZapSelectTxRet == DBErrors::NEED_REWRITE)

src/wallet/wallet.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -735,8 +735,7 @@ class CWallet final : public WalletStorage, public interfaces::Chain::Notificati
735735
* Wallet transaction added, removed or updated.
736736
* @note called with lock cs_wallet held.
737737
*/
738-
boost::signals2::signal<void (CWallet *wallet, const uint256 &hashTx,
739-
ChangeType status)> NotifyTransactionChanged;
738+
boost::signals2::signal<void(const uint256& hashTx, ChangeType status)> NotifyTransactionChanged;
740739

741740
/** Show progress e.g. for rescan */
742741
boost::signals2::signal<void (const std::string &title, int nProgress)> ShowProgress;

0 commit comments

Comments
 (0)