aboutsummaryrefslogtreecommitdiff
path: root/src/txdb.cpp
diff options
context:
space:
mode:
authorshaolinfry <[email protected]>2017-02-18 11:13:07 +0000
committerRoss Nicoll <[email protected]>2021-05-30 22:54:48 +0100
commit202871da44b51902d5bc22c50e930b2117f097b0 (patch)
treefbf71c25599a55811332e58fe6323b23f9f17f9b /src/txdb.cpp
parentMerge pull request #2210 from rnicoll/1.21-block-subsidy (diff)
downloaddiscoin-202871da44b51902d5bc22c50e930b2117f097b0.tar.xz
discoin-202871da44b51902d5bc22c50e930b2117f097b0.zip
Litecoin: Add scrypt N=1024 PoW
Diffstat (limited to 'src/txdb.cpp')
-rw-r--r--src/txdb.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/txdb.cpp b/src/txdb.cpp
index 72460e7c6..8f7820bc5 100644
--- a/src/txdb.cpp
+++ b/src/txdb.cpp
@@ -271,8 +271,14 @@ bool CBlockTreeDB::LoadBlockIndexGuts(const Consensus::Params& consensusParams,
pindexNew->nStatus = diskindex.nStatus;
pindexNew->nTx = diskindex.nTx;
- if (!CheckProofOfWork(pindexNew->GetBlockHash(), pindexNew->nBits, consensusParams))
- return error("%s: CheckProofOfWork failed: %s", __func__, 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, consensusParams))
+ // return error("%s: CheckProofOfWork failed: %s", __func__, pindexNew->ToString());
pcursor->Next();
} else {