mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Refactor proof of work related functions out of main
This commit is contained in:
parent
36db6633c3
commit
df852d2bcc
9 changed files with 155 additions and 124 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue