diff --git a/src/interfaces/wallet.h b/src/interfaces/wallet.h index 50290965b6d..8eab79bcc58 100644 --- a/src/interfaces/wallet.h +++ b/src/interfaces/wallet.h @@ -125,6 +125,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; diff --git a/src/wallet/interfaces.cpp b/src/wallet/interfaces.cpp index 8914b13f8e8..d2c167f593c 100644 --- a/src/wallet/interfaces.cpp +++ b/src/wallet/interfaces.cpp @@ -244,6 +244,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);