Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 3,330 Lines • ▼ Show 20 Lines | void PeerManagerImpl::ProcessGetBlockData(const Config &config, CNode &pfrom, | ||||
| std::shared_ptr<const CBlock> pblock; | std::shared_ptr<const CBlock> pblock; | ||||
| if (a_recent_block && a_recent_block->GetHash() == pindex->GetBlockHash()) { | if (a_recent_block && a_recent_block->GetHash() == pindex->GetBlockHash()) { | ||||
| pblock = a_recent_block; | pblock = a_recent_block; | ||||
| } else { | } else { | ||||
| // Send block from disk | // Send block from disk | ||||
| std::shared_ptr<CBlock> pblockRead = std::make_shared<CBlock>(); | std::shared_ptr<CBlock> pblockRead = std::make_shared<CBlock>(); | ||||
| if (!m_chainman.m_blockman.ReadBlockFromDisk(*pblockRead, block_pos)) { | if (!m_chainman.m_blockman.ReadBlockFromDisk(*pblockRead, block_pos)) { | ||||
| if (WITH_LOCK(m_chainman.GetMutex(), | if (WITH_LOCK( | ||||
| return m_chainman.m_blockman.IsBlockPruned(pindex))) { | m_chainman.GetMutex(), | ||||
| return m_chainman.m_blockman.IsBlockPruned(*pindex))) { | |||||
| LogPrint(BCLog::NET, | LogPrint(BCLog::NET, | ||||
| "Block was pruned before it could be read, disconnect " | "Block was pruned before it could be read, disconnect " | ||||
| "peer=%s\n", | "peer=%s\n", | ||||
| pfrom.GetId()); | pfrom.GetId()); | ||||
| } else { | } else { | ||||
| LogPrintLevel( | LogPrintLevel( | ||||
| BCLog::NET, BCLog::Level::Error, | BCLog::NET, BCLog::Level::Error, | ||||
| "Cannot load block from disk, disconnect peer=%d\n", | "Cannot load block from disk, disconnect peer=%d\n", | ||||
| ▲ Show 20 Lines • Show All 5,928 Lines • Show Last 20 Lines | |||||