diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2015-02-16 11:55:51 -0800 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2015-02-16 11:58:35 -0800 |
commit | 175d86e633bedcfb642fb326f1ec0b43c14c4f3b (patch) | |
tree | be67cf54b84e46bdd5d14f341c9a2f08c9dfd21d /src/main.cpp | |
parent | a77021a76361108b21d1e3b59c56915ad82655a5 (diff) | |
parent | f5791c6ae3b59ef4c8d04e6873310a022e1211b6 (diff) |
Merge #5710: Add more information to errors in ReadBlockFromDisk
f5791c6 Add more information to errors in ReadBlockFromDisk (Wladimir J. van der Laan)
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp index fb2b2482e6..34b4c51d5f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1199,19 +1199,19 @@ bool ReadBlockFromDisk(CBlock& block, const CDiskBlockPos& pos) // Open history file to read CAutoFile filein(OpenBlockFile(pos, true), SER_DISK, CLIENT_VERSION); if (filein.IsNull()) - return error("ReadBlockFromDisk: OpenBlockFile failed"); + return error("ReadBlockFromDisk: OpenBlockFile failed for %s", pos.ToString()); // Read block try { filein >> block; } catch (const std::exception& e) { - return error("%s: Deserialize or I/O error - %s", __func__, e.what()); + return error("%s: Deserialize or I/O error - %s at %s", __func__, e.what(), pos.ToString()); } // Check the header if (!CheckProofOfWork(block.GetHash(), block.nBits)) - return error("ReadBlockFromDisk: Errors in block header"); + return error("ReadBlockFromDisk: Errors in block header at %s", pos.ToString()); return true; } @@ -1221,7 +1221,8 @@ bool ReadBlockFromDisk(CBlock& block, const CBlockIndex* pindex) if (!ReadBlockFromDisk(block, pindex->GetBlockPos())) return false; if (block.GetHash() != pindex->GetBlockHash()) - return error("ReadBlockFromDisk(CBlock&, CBlockIndex*): GetHash() doesn't match index"); + return error("ReadBlockFromDisk(CBlock&, CBlockIndex*): GetHash() doesn't match index for %s at %s", + pindex->ToString(), pindex->GetBlockPos().ToString()); return true; } |