diff options
author | R E Broadley <rebroad+github@gmail.com> | 2012-05-14 19:39:50 +0100 |
---|---|---|
committer | R E Broadley <rebroad+github@gmail.com> | 2012-05-29 20:11:37 +0100 |
commit | e69a7979901d1df8f0d90fcd4e1a21eb1fd38602 (patch) | |
tree | d576e0ad79d5f222fed90eac439569958624cbec /src | |
parent | f6521b66f7d4e7c3d55e0fd1d006fd6311afc18f (diff) |
Show the timestamp for the block.
wrap lines
Diffstat (limited to 'src')
-rw-r--r-- | src/db.cpp | 4 | ||||
-rw-r--r-- | src/main.cpp | 13 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/db.cpp b/src/db.cpp index 4f4e1d84b7..2928eff006 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -570,7 +570,9 @@ bool CTxDB::LoadBlockIndex() pindexBest = mapBlockIndex[hashBestChain]; nBestHeight = pindexBest->nHeight; bnBestChainWork = pindexBest->bnChainWork; - printf("LoadBlockIndex(): hashBestChain=%s height=%d\n", hashBestChain.ToString().substr(0,20).c_str(), nBestHeight); + printf("LoadBlockIndex(): hashBestChain=%s height=%d date=%s\n", + hashBestChain.ToString().substr(0,20).c_str(), nBestHeight, + DateTimeStrFormat("%x %H:%M:%S", pindexBest->GetBlockTime()).c_str()); // Load bnBestInvalidWork, OK if it doesn't exist ReadBestInvalidWork(bnBestInvalidWork); diff --git a/src/main.cpp b/src/main.cpp index 981de62659..8de01c1a6c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -962,8 +962,13 @@ void static InvalidChainFound(CBlockIndex* pindexNew) CTxDB().WriteBestInvalidWork(bnBestInvalidWork); uiInterface.NotifyBlocksChanged(); } - printf("InvalidChainFound: invalid block=%s height=%d work=%s\n", pindexNew->GetBlockHash().ToString().substr(0,20).c_str(), pindexNew->nHeight, pindexNew->bnChainWork.ToString().c_str()); - printf("InvalidChainFound: current best=%s height=%d work=%s\n", hashBestChain.ToString().substr(0,20).c_str(), nBestHeight, bnBestChainWork.ToString().c_str()); + printf("InvalidChainFound: invalid block=%s height=%d work=%s date=%s\n", + pindexNew->GetBlockHash().ToString().substr(0,20).c_str(), pindexNew->nHeight, + pindexNew->bnChainWork.ToString().c_str(), DateTimeStrFormat("%x %H:%M:%S", + pindexNew->GetBlockTime()).c_str()); + printf("InvalidChainFound: current best=%s height=%d work=%s date=%s\n", + hashBestChain.ToString().substr(0,20).c_str(), nBestHeight, bnBestChainWork.ToString().c_str(), + DateTimeStrFormat("%x %H:%M:%S", pindexBest->GetBlockTime()).c_str()); if (pindexBest && bnBestInvalidWork > bnBestChainWork + pindexBest->GetBlockWork() * 6) printf("InvalidChainFound: WARNING: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.\n"); } @@ -1606,7 +1611,9 @@ bool CBlock::SetBestChain(CTxDB& txdb, CBlockIndex* pindexNew) bnBestChainWork = pindexNew->bnChainWork; nTimeBestReceived = GetTime(); nTransactionsUpdated++; - printf("SetBestChain: new best=%s height=%d work=%s\n", hashBestChain.ToString().substr(0,20).c_str(), nBestHeight, bnBestChainWork.ToString().c_str()); + printf("SetBestChain: new best=%s height=%d work=%s date=%s\n", + hashBestChain.ToString().substr(0,20).c_str(), nBestHeight, bnBestChainWork.ToString().c_str(), + DateTimeStrFormat("%x %H:%M:%S", pindexBest->GetBlockTime()).c_str()); std::string strCmd = GetArg("-blocknotify", ""); |