| 1370 | } |
| 1371 | |
| 1372 | void PeerManagerImpl::ProcessBlockAvailability(NodeId nodeid) { |
| 1373 | CNodeState *state = State(nodeid); |
| 1374 | assert(state != nullptr); |
| 1375 | |
| 1376 | if (!state->hashLastUnknownBlock.IsNull()) { |
| 1377 | const CBlockIndex* pindex = m_chainman.m_blockman.LookupBlockIndex(state->hashLastUnknownBlock); |
| 1378 | if (pindex && pindex->nChainWork > 0) { |
| 1379 | if (state->pindexBestKnownBlock == nullptr || pindex->nChainWork >= state->pindexBestKnownBlock->nChainWork) { |
| 1380 | state->pindexBestKnownBlock = pindex; |
| 1381 | } |
| 1382 | state->hashLastUnknownBlock.SetNull(); |
| 1383 | } |
| 1384 | } |
| 1385 | } |
| 1386 | |
| 1387 | void PeerManagerImpl::UpdateBlockAvailability(NodeId nodeid, const uint256 &hash) { |
| 1388 | CNodeState *state = State(nodeid); |
nothing calls this directly
no test coverage detected