Refactor proof of work related functions out of main

This commit is contained in:
jtimon
2014-03-10 08:46:53 -07:00
parent 36db6633c3
commit df852d2bcc
9 changed files with 155 additions and 124 deletions

View File

@@ -6,6 +6,7 @@
#include "txdb.h"
#include "core.h"
#include "pow.h"
#include "uint256.h"
#include <stdint.h>
@@ -212,8 +213,8 @@ bool CBlockTreeDB::LoadBlockIndexGuts()
pindexNew->nStatus = diskindex.nStatus;
pindexNew->nTx = diskindex.nTx;
if (!pindexNew->CheckIndex())
return error("LoadBlockIndex() : CheckIndex failed: %s", pindexNew->ToString());
if (!CheckProofOfWork(pindexNew->GetBlockHash(), pindexNew->nBits))
return error("LoadBlockIndex() : CheckProofOfWork failed: %s", pindexNew->ToString());
pcursor->Next();
} else {