Skip to content
Permalink
Browse files

Showing 'involvesWatchonly' property for transactions returned by 'li…

…sttransactions' and 'listsinceblock'.

It is only appended when the transaction involves a watchonly address.
  • Loading branch information...
sdkfjlsfjlskdfjlsdjflsjf committed Apr 9, 2014
1 parent 83f3543 commit 952877e01c1045298fd51d1152d96c304d4cf2a4
Showing with 7 additions and 2 deletions.
  1. +5 −0 src/rpcwallet.cpp
  2. +2 −2 src/wallet.h
@@ -1117,13 +1117,16 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe
wtx.GetAmounts(listReceived, listSent, nFee, strSentAccount);

bool fAllAccounts = (strAccount == string("*"));
bool involvesWatchonly = wtx.IsFromMe(MINE_WATCH_ONLY);

// Sent
if ((!listSent.empty() || nFee != 0) && (fAllAccounts || strAccount == strSentAccount))
{
BOOST_FOREACH(const PAIRTYPE(CTxDestination, int64_t)& s, listSent)
{
Object entry;
if(involvesWatchonly || (::IsMine(*pwalletMain, s.first) & MINE_WATCH_ONLY))
entry.push_back(Pair("involvesWatchonly", true));
entry.push_back(Pair("account", strSentAccount));
MaybePushAddress(entry, s.first);
entry.push_back(Pair("category", "send"));
@@ -1146,6 +1149,8 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe
if (fAllAccounts || (account == strAccount))
{
Object entry;
if(involvesWatchonly || (::IsMine(*pwalletMain, r.first) & MINE_WATCH_ONLY))
entry.push_back(Pair("involvesWatchonly", true));
entry.push_back(Pair("account", account));
MaybePushAddress(entry, r.first);
if (wtx.IsCoinBase())
@@ -761,9 +761,9 @@ class CWalletTx : public CMerkleTx
void GetAccountAmounts(const std::string& strAccount, int64_t& nReceived,
int64_t& nSent, int64_t& nFee, const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const;

bool IsFromMe() const
bool IsFromMe(const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const
{
return (GetDebit() > 0);
return (GetDebit(filter) > 0);
}

bool IsTrusted() const

0 comments on commit 952877e

Please sign in to comment.
You can’t perform that action at this time.