aboutsummaryrefslogtreecommitdiff
path: root/src/rpcwallet.cpp
diff options
context:
space:
mode:
authorJaSK <temp@temp.temp>2014-04-09 17:20:07 +0200
committerJaSK <temp@temp.temp>2014-07-02 15:48:38 +0200
commit952877e01c1045298fd51d1152d96c304d4cf2a4 (patch)
tree5cfd0dcb93f537886f0babf683e0953d8a2786b9 /src/rpcwallet.cpp
parent83f3543f20348aa718620314e7deb37bd0f71b90 (diff)
downloadbitcoin-952877e01c1045298fd51d1152d96c304d4cf2a4.tar.xz
Showing 'involvesWatchonly' property for transactions returned by 'listtransactions' and 'listsinceblock'.
It is only appended when the transaction involves a watchonly address.
Diffstat (limited to 'src/rpcwallet.cpp')
-rw-r--r--src/rpcwallet.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp
index d52a4bc5bb..8de10c52f8 100644
--- a/src/rpcwallet.cpp
+++ b/src/rpcwallet.cpp
@@ -1117,6 +1117,7 @@ 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))
@@ -1124,6 +1125,8 @@ void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDe
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())