rpcwallet: add 'ischange' field to 'getaddressinfo' response
This commit is contained in:
@@ -1261,6 +1261,11 @@ CAmount CWallet::GetCredit(const CTxOut& txout, const isminefilter& filter) cons
|
||||
}
|
||||
|
||||
bool CWallet::IsChange(const CTxOut& txout) const
|
||||
{
|
||||
return IsChange(txout.scriptPubKey);
|
||||
}
|
||||
|
||||
bool CWallet::IsChange(const CScript& script) const
|
||||
{
|
||||
// TODO: fix handling of 'change' outputs. The assumption is that any
|
||||
// payment to a script that is ours, but is not in the address book
|
||||
@@ -1269,10 +1274,10 @@ bool CWallet::IsChange(const CTxOut& txout) const
|
||||
// a better way of identifying which outputs are 'the send' and which are
|
||||
// 'the change' will need to be implemented (maybe extend CWalletTx to remember
|
||||
// which output, if any, was change).
|
||||
if (::IsMine(*this, txout.scriptPubKey))
|
||||
if (::IsMine(*this, script))
|
||||
{
|
||||
CTxDestination address;
|
||||
if (!ExtractDestination(txout.scriptPubKey, address))
|
||||
if (!ExtractDestination(script, address))
|
||||
return true;
|
||||
|
||||
LOCK(cs_wallet);
|
||||
|
||||
Reference in New Issue
Block a user