Remove unused wallet pointer from NotifyAddressBookChanged

This commit is contained in:
MarcoFalke 2021-06-28 10:51:32 +02:00
parent faf3640303
commit 8888cf45f5
No known key found for this signature in database
GPG key ID: CE2B75697E69A548
3 changed files with 10 additions and 10 deletions

View file

@ -475,7 +475,7 @@ public:
std::unique_ptr<Handler> handleAddressBookChanged(AddressBookChangedFn fn) override std::unique_ptr<Handler> handleAddressBookChanged(AddressBookChangedFn fn) override
{ {
return MakeHandler(m_wallet->NotifyAddressBookChanged.connect( return MakeHandler(m_wallet->NotifyAddressBookChanged.connect(
[fn](CWallet*, const CTxDestination& address, const std::string& label, bool is_mine, [fn](const CTxDestination& address, const std::string& label, bool is_mine,
const std::string& purpose, ChangeType status) { fn(address, label, is_mine, purpose, status); })); const std::string& purpose, ChangeType status) { fn(address, label, is_mine, purpose, status); }));
} }
std::unique_ptr<Handler> handleTransactionChanged(TransactionChangedFn fn) override std::unique_ptr<Handler> handleTransactionChanged(TransactionChangedFn fn) override

View file

@ -2033,8 +2033,8 @@ bool CWallet::SetAddressBookWithDB(WalletBatch& batch, const CTxDestination& add
m_address_book[address].purpose = strPurpose; m_address_book[address].purpose = strPurpose;
is_mine = IsMine(address) != ISMINE_NO; is_mine = IsMine(address) != ISMINE_NO;
} }
NotifyAddressBookChanged(this, address, strName, is_mine, NotifyAddressBookChanged(address, strName, is_mine,
strPurpose, (fUpdated ? CT_UPDATED : CT_NEW) ); strPurpose, (fUpdated ? CT_UPDATED : CT_NEW));
if (!strPurpose.empty() && !batch.WritePurpose(EncodeDestination(address), strPurpose)) if (!strPurpose.empty() && !batch.WritePurpose(EncodeDestination(address), strPurpose))
return false; return false;
return batch.WriteName(EncodeDestination(address), strName); return batch.WriteName(EncodeDestination(address), strName);
@ -2069,7 +2069,7 @@ bool CWallet::DelAddressBook(const CTxDestination& address)
is_mine = IsMine(address) != ISMINE_NO; is_mine = IsMine(address) != ISMINE_NO;
} }
NotifyAddressBookChanged(this, address, "", is_mine, "", CT_DELETED); NotifyAddressBookChanged(address, "", is_mine, "", CT_DELETED);
batch.ErasePurpose(EncodeDestination(address)); batch.ErasePurpose(EncodeDestination(address));
return batch.EraseName(EncodeDestination(address)); return batch.EraseName(EncodeDestination(address));

View file

@ -724,12 +724,12 @@ public:
/** /**
* Address book entry changed. * Address book entry changed.
* @note called with lock cs_wallet held. * @note called without lock cs_wallet held.
*/ */
boost::signals2::signal<void (CWallet *wallet, const CTxDestination boost::signals2::signal<void(const CTxDestination& address,
&address, const std::string &label, bool isMine, const std::string& label, bool isMine,
const std::string &purpose, const std::string& purpose, ChangeType status)>
ChangeType status)> NotifyAddressBookChanged; NotifyAddressBookChanged;
/** /**
* Wallet transaction added, removed or updated. * Wallet transaction added, removed or updated.