From ef9242b9ec46a28690e49debe2c2364bb70be702 Mon Sep 17 00:00:00 2001 From: Shibe Date: Mon, 8 Feb 2021 04:54:51 +0400 Subject: Don't re-check AuxPoW when sending data to peers Checking scrypt PoW is expensive and needless in this case. All block headers are already checked when they are accepted, and they will be checked again on the receiving end. --- src/chain.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/chain.cpp') diff --git a/src/chain.cpp b/src/chain.cpp index 2ce98818f..e618f0568 100644 --- a/src/chain.cpp +++ b/src/chain.cpp @@ -10,7 +10,7 @@ using namespace std; /* Moved here from the header, because we need auxpow and the logic becomes more involved. */ -CBlockHeader CBlockIndex::GetBlockHeader(const Consensus::Params& consensusParams) const +CBlockHeader CBlockIndex::GetBlockHeader(const Consensus::Params& consensusParams, bool fCheckPOW) const { CBlockHeader block; @@ -21,7 +21,7 @@ CBlockHeader CBlockIndex::GetBlockHeader(const Consensus::Params& consensusParam have to read the actual *header*, not the full block. */ if (block.IsAuxpow()) { - ReadBlockHeaderFromDisk(block, this, consensusParams); + ReadBlockHeaderFromDisk(block, this, consensusParams, fCheckPOW); return block; } -- cgit v1.2.3