changeset 3519:ee252c914681 draft

Merge pull request #1717 from Diapolo/Qt_change_TX_display Qt: show mined transactions at depth 1
author Wladimir J. van der Laan <laanwj@gmail.com>
date Thu, 20 Sep 2012 00:42:31 -0700
parents f52aad65e8c7 (current diff) 1e1e1ebe3fca (diff)
children ce8540bec751 5d53d9270587
files src/wallet.cpp
diffstat 2 files changed, 3 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/qt/transactionrecord.cpp
+++ b/src/qt/transactionrecord.cpp
@@ -9,18 +9,8 @@
 {
     if (wtx.IsCoinBase())
     {
-        // Don't show generated coin until confirmed by at least one block after it
-        // so we don't get the user's hopes up until it looks like it's probably accepted.
-        //
-        // It is not an error when generated blocks are not accepted.  By design,
-        // some percentage of blocks, like 10% or more, will end up not accepted.
-        // This is the normal mechanism by which the network copes with latency.
-        //
-        // We display regular transactions right away before any confirmation
-        // because they can always get into some block eventually.  Generated coins
-        // are special because if their block is not accepted, they are not valid.
-        //
-        if (wtx.GetDepthInMainChain() < 2)
+        // Ensures we show generated coins / mined transactions at depth 1
+        if (!wtx.IsInMainChain())
         {
             return false;
         }
--- a/src/wallet.cpp
+++ b/src/wallet.cpp
@@ -960,7 +960,7 @@
         for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
         {
             const CWalletTx& pcoin = (*it).second;
-            if (pcoin.IsCoinBase() && pcoin.GetBlocksToMaturity() > 0 && pcoin.GetDepthInMainChain() >= 2)
+            if (pcoin.IsCoinBase() && pcoin.GetBlocksToMaturity() > 0 && pcoin.IsInMainChain())
                 nTotal += GetCredit(pcoin);
         }
     }