aboutsummaryrefslogtreecommitdiff
path: root/src/main.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.h')
-rw-r--r--src/main.h25
1 files changed, 1 insertions, 24 deletions
diff --git a/src/main.h b/src/main.h
index 3cd0143c65..47a9fb3381 100644
--- a/src/main.h
+++ b/src/main.h
@@ -726,30 +726,7 @@ public:
/** Functions for disk access for blocks */
bool WriteBlockToDisk(CBlock& block, CDiskBlockPos& pos);
-inline bool ReadBlockFromDisk(CBlock& block, const CDiskBlockPos& pos)
-{
- block.SetNull();
-
- // Open history file to read
- CAutoFile filein = CAutoFile(OpenBlockFile(pos, true), SER_DISK, CLIENT_VERSION);
- if (!filein)
- return error("ReadBlockFromDisk(CBlock&, CDiskBlockPos&) : OpenBlockFile failed");
-
- // Read block
- try {
- filein >> block;
- }
- catch (std::exception &e) {
- return error("%s() : deserialize or I/O error", __PRETTY_FUNCTION__);
- }
-
- // Check the header
- if (!CheckProofOfWork(block.GetHash(), block.nBits))
- return error("ReadBlockFromDisk(CBlock&, CDiskBlockPos&) : errors in block header");
-
- return true;
-}
-
+bool ReadBlockFromDisk(CBlock& block, const CDiskBlockPos& pos);
bool ReadBlockFromDisk(CBlock& block, const CBlockIndex* pindex);