message: Optimized code, fixed mint/spend amount view
diff: @@ -42,55 +42,41 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
  uint256 hash = wtx.GetHash();
  std::map<std::string, std::string> mapValue = wtx.mapValue;
  - if(wtx.IsZerocoinSpend() || wtx.IsZerocoinSpendV3())
  + if (nNet > 0 || wtx.IsCoinBase() ||
  + wtx.IsZerocoinSpend() || wtx.IsZerocoinSpendV3())
  {
  + //
  + // Credit
  + //
  BOOST_FOREACH(const CTxOut& txout, wtx.vout)
  {
  isminetype mine = wallet->IsMine(txout);
  TransactionRecord sub(hash, nTime);
  CTxDestination address;
  + sub.idx = parts.size(); // sequence number
  + sub.credit = txout.nValue;
  - sub.involvesWatchAddress = mine & ISMINE_WATCH_ONLY;
  + if(wtx.IsZerocoinSpend() || wtx.IsZerocoinSpendV3())
  + {
  if (mine)
  {
  + sub.involvesWatchAddress = mine & ISMINE_WATCH_ONLY;
  if (ExtractDestination(txout.scriptPubKey, address) && IsMine(*wallet, address))
  {
  sub.type = TransactionRecord::SpendToSelf;
  sub.address = CBitcoinAddress(address).ToString();
  }
  }
  - else if(ExtractDestination(txout.scriptPubKey, address))
  + else
  {
  + ExtractDestination(txout.scriptPubKey, address);
  sub.type = TransactionRecord::SpendToAddress;
  sub.address = CBitcoinAddress(address).ToString();
  }
  - parts.append(sub);
  - }
  }
  - else if(wtx.IsZerocoinMint() || wtx.IsZerocoinMintV3())
  - {
  - TransactionRecord sub(hash, nTime);
  - BOOST_FOREACH(const CTxIn& txin, wtx.vin)
  + else if(mine)
  {
  - sub.type = TransactionRecord::Mint;
  - parts.append(sub);
  - }
  - }
  - else if (nNet > 0 || wtx.IsCoinBase())
  - {
  - //
  - // Credit
  - //
  - BOOST_FOREACH(const CTxOut& txout, wtx.vout)
  - {
  - isminetype mine = wallet->IsMine(txout);
  - if(mine)
  - {
  - TransactionRecord sub(hash, nTime);
  - CTxDestination address;
  - sub.idx = parts.size(); // sequence number
  - sub.credit = txout.nValue;
  sub.involvesWatchAddress = mine & ISMINE_WATCH_ONLY;
  if(ExtractDestination(txout.scriptPubKey, address) && IsMine(*wallet, address))
  {
  @@ -109,9 +95,8 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
  // Generated
  sub.type = TransactionRecord::Generated;
  }
  -
  - parts.append(sub);
  }
  + parts.append(sub);
  }
  }
  else
  @@ -170,6 +155,10 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
  sub.type = TransactionRecord::SendToAddress;
  sub.address = CBitcoinAddress(address).ToString();
  }
  + else if(wtx.IsZerocoinMint() || wtx.IsZerocoinMintV3())
  + {
  + sub.type = TransactionRecord::Mint;
  + }
  else
  {
  // Sent to IP, or other non-address transaction like OP_EVAL
  