Skip to content

Commit b1b9278

Browse files
committed
interfaces: Add isChange to wallet interface
1 parent 7e68e6f commit b1b9278

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/interfaces/wallet.h

+3
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ class Wallet
123123
//! Save or remove receive request.
124124
virtual bool setAddressReceiveRequest(const CTxDestination& dest, const std::string& id, const std::string& value) = 0;
125125

126+
//! Whether the given output is a change
127+
virtual bool isChange(const CTxOut& txout) const = 0;
128+
126129
//! Display address on external signer
127130
virtual bool displayAddress(const CTxDestination& dest) = 0;
128131

src/wallet/interfaces.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,11 @@ class WalletImpl : public Wallet
224224
WalletBatch batch{m_wallet->GetDatabase()};
225225
return m_wallet->SetAddressReceiveRequest(batch, dest, id, value);
226226
}
227+
bool isChange(const CTxOut& txout) const override
228+
{
229+
LOCK(m_wallet->cs_wallet);
230+
return OutputIsChange(*m_wallet, txout);
231+
}
227232
bool displayAddress(const CTxDestination& dest) override
228233
{
229234
LOCK(m_wallet->cs_wallet);

0 commit comments

Comments
 (0)