PPCoin: Print coinstake info with printblocktree
authorSunny King <sunnyking9999@gmail.com>
Wed, 30 May 2012 16:56:34 +0000 (17:56 +0100)
committerSunny King <sunnyking9999@gmail.com>
Wed, 30 May 2012 16:56:34 +0000 (17:56 +0100)
src/wallet.cpp

index c245f84..bab18b6 100644 (file)
@@ -1341,10 +1341,15 @@ void CWallet::PrintWallet(const CBlock& block)
 {
     CRITICAL_BLOCK(cs_wallet)
     {
-        if (mapWallet.count(block.vtx[0].GetHash()))
+        if (block.IsProofOfWork() && mapWallet.count(block.vtx[0].GetHash()))
         {
             CWalletTx& wtx = mapWallet[block.vtx[0].GetHash()];
-            printf("    mine:  %d  %d  %d", wtx.GetDepthInMainChain(), wtx.GetBlocksToMaturity(), wtx.GetCredit());
+            printf("    mine:  %d  %d  %s", wtx.GetDepthInMainChain(), wtx.GetBlocksToMaturity(), FormatMoney(wtx.GetCredit()).c_str());
+        }
+        if (block.IsProofOfStake() && mapWallet.count(block.vtx[1].GetHash()))
+        {
+            CWalletTx& wtx = mapWallet[block.vtx[1].GetHash()];
+            printf("    stake: %d  %d  %s", wtx.GetDepthInMainChain(), wtx.GetBlocksToMaturity(), FormatMoney(wtx.GetCredit()).c_str());
         }
     }
     printf("\n");