mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 06:43:45 +01:00
Refactor proof of work related functions out of main
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user