3163@@ -3155,6 +3164,11 @@ void PeerManagerImpl::ProcessBlock(CNode& node, const std::shared_ptr<const CBlo
3164 m_chainman.ProcessNewBlock(block, force_processing, min_pow_checked, &new_block);
3165 if (new_block) {
3166 node.m_last_block_time = GetTime<std::chrono::seconds>();
3167+ // In case this block came from a different peer than we requested
3168+ // from, we can erase the block request now anyway (as we just stored
3169+ // this block to disk).
3170+ LOCK(cs_main);
nit: Could have moved the lock outside the if..else
and removed the duplicate line in the else
below.