Skip to content

Commit

Permalink
interfaces: Add isChange to wallet interface
Browse files Browse the repository at this point in the history
  • Loading branch information
achow101 committed Jul 20, 2023
1 parent 546afe8 commit 01a6f2b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/interfaces/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ class Wallet
//! Save or remove receive request.
virtual bool setAddressReceiveRequest(const CTxDestination& dest, const std::string& id, const std::string& value) = 0;

//! Whether the given output is a change
virtual bool isChange(const CTxOut& txout) const = 0;

//! Display address on external signer
virtual bool displayAddress(const CTxDestination& dest) = 0;

Expand Down
5 changes: 5 additions & 0 deletions src/wallet/interfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@ class WalletImpl : public Wallet
return value.empty() ? m_wallet->EraseAddressReceiveRequest(batch, dest, id)
: m_wallet->SetAddressReceiveRequest(batch, dest, id, value);
}
bool isChange(const CTxOut& txout) const override
{
LOCK(m_wallet->cs_wallet);
return OutputIsChange(*m_wallet, txout);
}
bool displayAddress(const CTxDestination& dest) override
{
LOCK(m_wallet->cs_wallet);
Expand Down

0 comments on commit 01a6f2b

Please sign in to comment.