mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Add purpose arg to Wallet::getAddress
Also make all arguments to getAddress required and document args at call sites.
This commit is contained in:
@@ -152,7 +152,10 @@ public:
|
||||
{
|
||||
return m_wallet.DelAddressBook(dest);
|
||||
}
|
||||
bool getAddress(const CTxDestination& dest, std::string* name, isminetype* is_mine) override
|
||||
bool getAddress(const CTxDestination& dest,
|
||||
std::string* name,
|
||||
isminetype* is_mine,
|
||||
std::string* purpose) override
|
||||
{
|
||||
LOCK(m_wallet.cs_wallet);
|
||||
auto it = m_wallet.mapAddressBook.find(dest);
|
||||
@@ -165,6 +168,9 @@ public:
|
||||
if (is_mine) {
|
||||
*is_mine = IsMine(m_wallet, dest);
|
||||
}
|
||||
if (purpose) {
|
||||
*purpose = it->second.purpose;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
std::vector<WalletAddress> getAddresses() override
|
||||
|
||||
@@ -99,8 +99,9 @@ public:
|
||||
|
||||
//! Look up address in wallet, return whether exists.
|
||||
virtual bool getAddress(const CTxDestination& dest,
|
||||
std::string* name = nullptr,
|
||||
isminetype* is_mine = nullptr) = 0;
|
||||
std::string* name,
|
||||
isminetype* is_mine,
|
||||
std::string* purpose) = 0;
|
||||
|
||||
//! Get wallet address list.
|
||||
virtual std::vector<WalletAddress> getAddresses() = 0;
|
||||
|
||||
Reference in New Issue
Block a user