mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-09-11 14:32:13 +00:00
Litecoin: Disable PoW Sanity check while loading block index from disk.
We use the sha256 hash for the block index for performance reasons, which is recorded for later use. CheckProofOfWork() uses the scrypt hash which is discarded after a block is accepted. While it is technically feasible to verify the PoW, doing so takes several minutes as it requires recomputing every PoW hash during every Litecoin startup. We opt instead to simply trust the data that is on your local disk.
This commit is contained in:
parent
1f553b07cf
commit
e30d65c009
@ -276,6 +276,11 @@ public:
|
||||
return *phashBlock;
|
||||
}
|
||||
|
||||
uint256 GetBlockPoWHash() const
|
||||
{
|
||||
return GetBlockHeader().GetPoWHash();
|
||||
}
|
||||
|
||||
int64_t GetBlockTime() const
|
||||
{
|
||||
return (int64_t)nTime;
|
||||
|
10
src/txdb.cpp
10
src/txdb.cpp
@ -199,8 +199,14 @@ bool CBlockTreeDB::LoadBlockIndexGuts(boost::function<CBlockIndex*(const uint256
|
||||
pindexNew->nStatus = diskindex.nStatus;
|
||||
pindexNew->nTx = diskindex.nTx;
|
||||
|
||||
if (!CheckProofOfWork(pindexNew->GetBlockHash(), pindexNew->nBits, Params().GetConsensus()))
|
||||
return error("LoadBlockIndex(): CheckProofOfWork failed: %s", pindexNew->ToString());
|
||||
// Litecoin: Disable PoW Sanity check while loading block index from disk.
|
||||
// We use the sha256 hash for the block index for performance reasons, which is recorded for later use.
|
||||
// CheckProofOfWork() uses the scrypt hash which is discarded after a block is accepted.
|
||||
// While it is technically feasible to verify the PoW, doing so takes several minutes as it
|
||||
// requires recomputing every PoW hash during every Litecoin startup.
|
||||
// We opt instead to simply trust the data that is on your local disk.
|
||||
//if (!CheckProofOfWork(pindexNew->GetBlockHash(), pindexNew->nBits, Params().GetConsensus()))
|
||||
// return error("LoadBlockIndex(): CheckProofOfWork failed: %s", pindexNew->ToString());
|
||||
|
||||
pcursor->Next();
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user