13
13
14
14
#include < QDateTime>
15
15
16
+ using wallet::ISMINE_NO;
16
17
using wallet::ISMINE_SPENDABLE;
17
18
using wallet::ISMINE_WATCH_ONLY;
18
19
using wallet::isminetype;
@@ -39,8 +40,21 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const interface
39
40
uint256 hash = wtx.tx ->GetHash ();
40
41
std::map<std::string, std::string> mapValue = wtx.value_map ;
41
42
42
- if (nNet > 0 || wtx.is_coinbase )
43
- {
43
+ bool involvesWatchAddress = false ;
44
+ isminetype fAllFromMe = ISMINE_SPENDABLE;
45
+ bool any_from_me = false ;
46
+ if (wtx.is_coinbase ) {
47
+ fAllFromMe = ISMINE_NO;
48
+ } else {
49
+ for (const isminetype mine : wtx.txin_is_mine )
50
+ {
51
+ if (mine & ISMINE_WATCH_ONLY) involvesWatchAddress = true ;
52
+ if (fAllFromMe > mine) fAllFromMe = mine;
53
+ if (mine) any_from_me = true ;
54
+ }
55
+ }
56
+
57
+ if (!any_from_me) {
44
58
//
45
59
// Credit
46
60
//
@@ -78,14 +92,6 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const interface
78
92
}
79
93
else
80
94
{
81
- bool involvesWatchAddress = false ;
82
- isminetype fAllFromMe = ISMINE_SPENDABLE;
83
- for (const isminetype mine : wtx.txin_is_mine )
84
- {
85
- if (mine & ISMINE_WATCH_ONLY) involvesWatchAddress = true ;
86
- if (fAllFromMe > mine) fAllFromMe = mine;
87
- }
88
-
89
95
isminetype fAllToMe = ISMINE_SPENDABLE;
90
96
for (const isminetype mine : wtx.txout_is_mine )
91
97
{
0 commit comments