diff -uNr a/bitcoin/src/main.cpp b/bitcoin/src/main.cpp --- a/bitcoin/src/main.cpp d49e7aaab38507fd69e6629b8baae80bc87d2071c842c8ede6f2d8e54f87e7d439c79b9a38ad94591e6fd5cf96196f2221426a4c8a2ffb282030fbcf810c18fb +++ b/bitcoin/src/main.cpp 1160cb4d3aa5dd0b023a03f05d51fa5b325b26216fb075c3203afae7967937e86cf3b2149c2d7cf1686f203904aa416bc192d643f85c4ebb82b000df18a5f6a8 @@ -1231,6 +1231,8 @@ bool CBlock::CheckBlock() const { + int64 nStart = GetTimeMillis(); + // These are checks that are independent of context // that can be verified before saving an orphan block. @@ -1266,11 +1268,14 @@ if (hashMerkleRoot != BuildMerkleTree()) return DoS(100, error("CheckBlock() : hashMerkleRoot mismatch")); + printf("CheckBlock() success : %"PRI64d"ms\n", GetTimeMillis() - nStart); return true; } bool CBlock::AcceptBlock() { + int64 nStart = GetTimeMillis(); + // Check for duplicate uint256 hash = GetHash(); if (mapBlockIndex.count(hash)) @@ -1317,6 +1322,7 @@ if (nBestHeight > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : 140700)) pnode->PushInventory(CInv(MSG_BLOCK, hash)); + printf("AcceptBlock() success : %"PRI64d"ms\n", GetTimeMillis() - nStart); return true; } @@ -2017,6 +2023,8 @@ else if (strCommand == "block") { + int64 nStart = GetTimeMillis(); + CBlock block; vRecv >> block; @@ -2029,6 +2037,8 @@ if (ProcessBlock(pfrom, &block)) mapAlreadyAskedFor.erase(inv); if (block.nDoS) pfrom->Misbehaving(block.nDoS); + + printf("Tested candidate block in %"PRI64d"ms\n", GetTimeMillis() - nStart); }