mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-26 19:23:26 -03:00
Merge #7225: Eliminate unnecessary call to CheckBlock
dbb89dc
Eliminate unnecessary call to CheckBlock (Suhas Daftuar)
This commit is contained in:
commit
eb331794a2
1 changed files with 0 additions and 6 deletions
|
@ -3169,16 +3169,10 @@ static bool IsSuperMajority(int minVersion, const CBlockIndex* pstart, unsigned
|
||||||
|
|
||||||
bool ProcessNewBlock(CValidationState& state, const CChainParams& chainparams, const CNode* pfrom, const CBlock* pblock, bool fForceProcessing, CDiskBlockPos* dbp)
|
bool ProcessNewBlock(CValidationState& state, const CChainParams& chainparams, const CNode* pfrom, const CBlock* pblock, bool fForceProcessing, CDiskBlockPos* dbp)
|
||||||
{
|
{
|
||||||
// Preliminary checks
|
|
||||||
bool checked = CheckBlock(*pblock, state);
|
|
||||||
|
|
||||||
{
|
{
|
||||||
LOCK(cs_main);
|
LOCK(cs_main);
|
||||||
bool fRequested = MarkBlockAsReceived(pblock->GetHash());
|
bool fRequested = MarkBlockAsReceived(pblock->GetHash());
|
||||||
fRequested |= fForceProcessing;
|
fRequested |= fForceProcessing;
|
||||||
if (!checked) {
|
|
||||||
return error("%s: CheckBlock FAILED %s", __func__, FormatStateMessage(state));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Store to disk
|
// Store to disk
|
||||||
CBlockIndex *pindex = NULL;
|
CBlockIndex *pindex = NULL;
|
||||||
|
|
Loading…
Add table
Reference in a new issue