aboutsummaryrefslogtreecommitdiff
path: root/src/qt/transactionrecord.cpp
diff options
context:
space:
mode:
authorJaSK <temp@temp.temp>2014-04-05 21:36:48 +0200
committerJaSK <temp@temp.temp>2014-07-02 15:48:38 +0200
commitd2692f61164730322547871f2124de06ade0436b (patch)
tree311a39b0f3fe010a7960aa29e41420b160ae7f55 /src/qt/transactionrecord.cpp
parentffd40da361639faeef405c7e4a504a340d77aa5b (diff)
Watchonly transactions are marked in transaction history
Diffstat (limited to 'src/qt/transactionrecord.cpp')
-rw-r--r--src/qt/transactionrecord.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp
index 3d77d39893..1011363f3e 100644
--- a/src/qt/transactionrecord.cpp
+++ b/src/qt/transactionrecord.cpp
@@ -70,16 +70,19 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
sub.type = TransactionRecord::Generated;
}
+ sub.involvesWatchAddress = mine == MINE_WATCH_ONLY;
parts.append(sub);
}
}
}
else
{
+ bool involvesWatchAddress = false;
isminetype fAllFromMe = MINE_SPENDABLE;
BOOST_FOREACH(const CTxIn& txin, wtx.vin)
{
isminetype mine = wallet->IsMine(txin);
+ if(mine == MINE_WATCH_ONLY) involvesWatchAddress = true;
if(fAllFromMe > mine) fAllFromMe = mine;
}
@@ -87,6 +90,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
{
isminetype mine = wallet->IsMine(txout);
+ if(mine == MINE_WATCH_ONLY) involvesWatchAddress = true;
if(fAllToMe > mine) fAllToMe = mine;
}
@@ -97,6 +101,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
parts.append(TransactionRecord(hash, nTime, TransactionRecord::SendToSelf, "",
-(nDebit - nChange), nCredit - nChange));
+ parts.last().involvesWatchAddress = involvesWatchAddress;
}
else if (fAllFromMe)
{
@@ -141,6 +146,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
}
sub.debit = -nValue;
+ sub.involvesWatchAddress = involvesWatchAddress;
parts.append(sub);
}
}
@@ -150,6 +156,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
// Mixed debit transaction, can't break down payees
//
parts.append(TransactionRecord(hash, nTime, TransactionRecord::Other, "", nNet, 0));
+ parts.last().involvesWatchAddress = involvesWatchAddress;
}
}