@@ -74,12 +74,10 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet*
7474 sub.type = TransactionRecord::StakeZPIV;
7575 sub.address = mapValue[" zerocoinmint" ];
7676 sub.credit = nNet;
77-
7877 for (const CTxOut& out : wtx.vout ) {
7978 if (out.IsZerocoinMint ())
80- sub.debit += out.nValue ;
79+ sub.credit += out.nValue ;
8180 }
82-
8381 sub.debit -= wtx.vin [0 ].nSequence * COIN;
8482 } else {
8583 isminetype mine = wallet->IsMine (wtx.vout [1 ]);
@@ -103,7 +101,6 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet*
103101 TransactionRecord sub (hash, nTime);
104102 sub.type = TransactionRecord::ZerocoinSpend_Change_zPiv;
105103 sub.address = mapValue[" zerocoinmint" ];
106- sub.debit = -txout.nValue ;
107104 if (!fFeeAssigned ) {
108105 sub.debit -= (wtx.GetZerocoinSpent () - wtx.GetValueOut ());
109106 fFeeAssigned = true ;
@@ -122,8 +119,12 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet*
122119 isminetype mine = wallet->IsMine (txout);
123120 if (mine) {
124121 TransactionRecord sub (hash, nTime);
125- sub.type = (fZSpendFromMe ? TransactionRecord::ZerocoinSpend_FromMe : TransactionRecord::RecvFromZerocoinSpend);
126- sub.debit = txout.nValue ;
122+ if (fZSpendFromMe ) {
123+ sub.type = TransactionRecord::ZerocoinSpend_FromMe;
124+ } else {
125+ sub.type = TransactionRecord::RecvFromZerocoinSpend;
126+ sub.credit = txout.nValue ;
127+ }
127128 sub.address = mapValue[" recvzerocoinspend" ];
128129 if (strAddress != " " )
129130 sub.address = strAddress;
@@ -269,6 +270,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet*
269270 } else if (txout.IsZerocoinMint ()){
270271 sub.type = TransactionRecord::ZerocoinMint;
271272 sub.address = mapValue[" zerocoinmint" ];
273+ sub.credit += txout.nValue ;
272274 } else {
273275 // Sent to IP, or other non-address transaction like OP_EVAL
274276 sub.type = TransactionRecord::SendToOther;
0 commit comments