PPCoin: Conditional print keypool reserve and return log message
authorScott Nadal <scott.nadal@gmail.com>
Tue, 7 Aug 2012 14:38:02 +0000 (15:38 +0100)
committerScott Nadal <scott.nadal@gmail.com>
Tue, 7 Aug 2012 14:38:02 +0000 (15:38 +0100)
        Conditional print create new block log message

src/main.cpp
src/wallet.cpp

index e8b8c61..e01be20 100644 (file)
@@ -3754,7 +3754,8 @@ CBlock* CreateNewBlock(CWallet* pwallet, bool fProofOfStake)
 
         nLastBlockTx = nBlockTx;
         nLastBlockSize = nBlockSize;
-        printf("CreateNewBlock(): total size %lu\n", nBlockSize);
+        if (fDebug && GetBoolArg("-printpriority"))
+            printf("CreateNewBlock(): total size %lu\n", nBlockSize);
 
     }
     if (pblock->IsProofOfWork())
index bfc57b6..6cc679b 100644 (file)
@@ -1593,7 +1593,8 @@ void CWallet::ReserveKeyFromKeyPool(int64& nIndex, CKeyPool& keypool)
         if (!HaveKey(Hash160(keypool.vchPubKey)))
             throw runtime_error("ReserveKeyFromKeyPool() : unknown key in key pool");
         assert(!keypool.vchPubKey.empty());
-        printf("keypool reserve %"PRI64d"\n", nIndex);
+        if (fDebug && GetBoolArg("-printkeypool"))
+            printf("keypool reserve %"PRI64d"\n", nIndex);
     }
 }
 
@@ -1630,7 +1631,8 @@ void CWallet::ReturnKey(int64 nIndex)
         LOCK(cs_wallet);
         setKeyPool.insert(nIndex);
     }
-    printf("keypool return %"PRI64d"\n", nIndex);
+    if (fDebug && GetBoolArg("-printkeypool"))
+        printf("keypool return %"PRI64d"\n", nIndex);
 }
 
 bool CWallet::GetKeyFromPool(vector<unsigned char>& result, bool fAllowReuse)