message: validation: move header validation error logging to VALIDATION debug category
diff: @@ -3198,7 +3198,7 @@ bool BlockManager::AcceptBlockHeader(const CBlockHeader& block, BlockValidationS
  if (ppindex)
  *ppindex = pindex;
  if (pindex->nStatus & BLOCK_FAILED_MASK) {
  - LogPrintf("ERROR: %s: block %s is marked invalid\n", __func__, hash.ToString());
  + LogPrint(BCLog::VALIDATION, "%s: block %s is marked invalid\n", __func__, hash.ToString());
  return state.Invalid(BlockValidationResult::BLOCK_CACHED_INVALID, "duplicate");
  }
  return true;
  @@ -3213,16 +3213,18 @@ bool BlockManager::AcceptBlockHeader(const CBlockHeader& block, BlockValidationS
  CBlockIndex* pindexPrev = nullptr;
  BlockMap::iterator mi = m_block_index.find(block.hashPrevBlock);
  if (mi == m_block_index.end()) {
  - LogPrintf("ERROR: %s: %s prev block not found\n", __func__, hash.ToString());
  + LogPrint(BCLog::VALIDATION, "%s: %s prev block not found\n", __func__, hash.ToString());
  return state.Invalid(BlockValidationResult::BLOCK_MISSING_PREV, "prev-blk-not-found");
  }
  pindexPrev = (*mi).second;
  if (pindexPrev->nStatus & BLOCK_FAILED_MASK) {
  - LogPrintf("ERROR: %s: %s prev block invalid\n", __func__, hash.ToString());
  + LogPrint(BCLog::VALIDATION, "%s: %s prev block invalid\n", __func__, hash.ToString());
  return state.Invalid(BlockValidationResult::BLOCK_INVALID_PREV, "bad-prevblk");
  }
  - if (!ContextualCheckBlockHeader(block, state, *this, chainparams, pindexPrev, GetAdjustedTime()))
  - return error("%s: Consensus::ContextualCheckBlockHeader: %s, %s", __func__, hash.ToString(), state.ToString());
  + if (!ContextualCheckBlockHeader(block, state, *this, chainparams, pindexPrev, GetAdjustedTime())) {
  + LogPrint(BCLog::VALIDATION, "%s: Consensus::ContextualCheckBlockHeader: %s, %s\n", __func__, hash.ToString(), state.ToString());
  + return false;
  + }
  /* Determine if this block descends from any block which has been found
  * invalid (m_failed_blocks), then mark pindexPrev and any blocks between
  @@ -3257,7 +3259,7 @@ bool BlockManager::AcceptBlockHeader(const CBlockHeader& block, BlockValidationS
  setDirtyBlockIndex.insert(invalid_walk);
  invalid_walk = invalid_walk->pprev;
  }
  - LogPrintf("ERROR: %s: %s prev block invalid\n", __func__, hash.ToString());
  + LogPrint(BCLog::VALIDATION, "%s: %s prev block invalid\n", __func__, hash.ToString());
  return state.Invalid(BlockValidationResult::BLOCK_INVALID_PREV, "bad-prevblk");
  }
  }
  