| 2565 | } |
| 2566 | |
| 2567 | void PeerManagerImpl::ProcessBlock(CNode& node, const std::shared_ptr<const CBlock>& block, bool force_processing) |
| 2568 | { |
| 2569 | bool new_block{false}; |
| 2570 | m_chainman.ProcessNewBlock(m_chainparams, block, force_processing, &new_block); |
| 2571 | if (new_block) { |
| 2572 | node.m_last_block_time = GetTime<std::chrono::seconds>(); |
| 2573 | // In case this block came from a different peer than we requested |
| 2574 | // from, we can erase the block request now anyway (as we just stored |
| 2575 | // this block to disk). |
| 2576 | LOCK(cs_main); |
| 2577 | RemoveBlockRequest(block->GetHash(), std::nullopt); |
| 2578 | } else { |
| 2579 | LOCK(cs_main); |
| 2580 | mapBlockSource.erase(block->GetHash()); |
| 2581 | } |
| 2582 | } |
| 2583 | |
| 2584 | void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type, CDataStream& vRecv, |
| 2585 | const std::chrono::microseconds time_received, |
nothing calls this directly
no test coverage detected