@@ -2791,9 +2791,8 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn
2791
2791
return true ;
2792
2792
}
2793
2793
2794
- bool AcceptBlockHeader (const CBlockHeader& block, CValidationState& state, CBlockIndex** ppindex)
2794
+ static bool AcceptBlockHeader (const CBlockHeader& block, CValidationState& state, const CChainParams& chainparams, CBlockIndex** ppindex= NULL )
2795
2795
{
2796
- const CChainParams& chainparams = Params ();
2797
2796
AssertLockHeld (cs_main);
2798
2797
// Check for duplicate
2799
2798
uint256 hash = block.GetHash ();
@@ -2846,7 +2845,7 @@ bool AcceptBlock(const CBlock& block, CValidationState& state, CBlockIndex** ppi
2846
2845
2847
2846
CBlockIndex *&pindex = *ppindex;
2848
2847
2849
- if (!AcceptBlockHeader (block, state, &pindex))
2848
+ if (!AcceptBlockHeader (block, state, chainparams, &pindex))
2850
2849
return false ;
2851
2850
2852
2851
// Try to process all requested blocks that we don't have, but only
@@ -4508,7 +4507,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
4508
4507
Misbehaving (pfrom->GetId (), 20 );
4509
4508
return error (" non-continuous headers sequence" );
4510
4509
}
4511
- if (!AcceptBlockHeader (header, state, &pindexLast)) {
4510
+ if (!AcceptBlockHeader (header, state, chainparams, &pindexLast)) {
4512
4511
int nDoS;
4513
4512
if (state.IsInvalid (nDoS)) {
4514
4513
if (nDoS > 0 )
0 commit comments