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 Jan 23, 2023
1 parent 7e68e6f commit b1b9278
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 @@ -123,6 +123,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 @@ -224,6 +224,11 @@ class WalletImpl : public Wallet
WalletBatch batch{m_wallet->GetDatabase()};
return 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 b1b9278

Please sign in to comment.