diff --git a/src/interfaces/wallet.h b/src/interfaces/wallet.h index c7195462e8b..d93ff7be64d 100644 --- a/src/interfaces/wallet.h +++ b/src/interfaces/wallet.h @@ -131,6 +131,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 util::Result displayAddress(const CTxDestination& dest) = 0; diff --git a/src/wallet/interfaces.cpp b/src/wallet/interfaces.cpp index 58b4da39171..ca6507daacf 100644 --- a/src/wallet/interfaces.cpp +++ b/src/wallet/interfaces.cpp @@ -249,6 +249,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); + } util::Result displayAddress(const CTxDestination& dest) override { LOCK(m_wallet->cs_wallet);