@@ -2781,9 +2781,8 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn
2781
2781
return true ;
2782
2782
}
2783
2783
2784
- bool AcceptBlockHeader (const CBlockHeader& block, CValidationState& state, CBlockIndex** ppindex)
2784
+ static bool AcceptBlockHeader (const CBlockHeader& block, CValidationState& state, const CChainParams& chainparams, CBlockIndex** ppindex= NULL )
2785
2785
{
2786
- const CChainParams& chainparams = Params ();
2787
2786
AssertLockHeld (cs_main);
2788
2787
// Check for duplicate
2789
2788
uint256 hash = block.GetHash ();
@@ -2836,7 +2835,7 @@ bool AcceptBlock(const CBlock& block, CValidationState& state, CBlockIndex** ppi
2836
2835
2837
2836
CBlockIndex *&pindex = *ppindex;
2838
2837
2839
- if (!AcceptBlockHeader (block, state, &pindex))
2838
+ if (!AcceptBlockHeader (block, state, chainparams, &pindex))
2840
2839
return false ;
2841
2840
2842
2841
// Try to process all requested blocks that we don't have, but only
@@ -4498,7 +4497,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
4498
4497
Misbehaving (pfrom->GetId (), 20 );
4499
4498
return error (" non-continuous headers sequence" );
4500
4499
}
4501
- if (!AcceptBlockHeader (header, state, &pindexLast)) {
4500
+ if (!AcceptBlockHeader (header, state, chainparams, &pindexLast)) {
4502
4501
int nDoS;
4503
4502
if (state.IsInvalid (nDoS)) {
4504
4503
if (nDoS > 0 )
0 commit comments