| 1009 | } |
| 1010 | |
| 1011 | void PeerManagerImpl::ProcessBlockAvailability(NodeId nodeid) { |
| 1012 | CNodeState *state = State(nodeid); |
| 1013 | assert(state != nullptr); |
| 1014 | |
| 1015 | if (!state->hashLastUnknownBlock.IsNull()) { |
| 1016 | const CBlockIndex* pindex = m_chainman.m_blockman.LookupBlockIndex(state->hashLastUnknownBlock); |
| 1017 | if (pindex && pindex->nChainWork > 0) { |
| 1018 | if (state->pindexBestKnownBlock == nullptr || pindex->nChainWork >= state->pindexBestKnownBlock->nChainWork) { |
| 1019 | state->pindexBestKnownBlock = pindex; |
| 1020 | } |
| 1021 | state->hashLastUnknownBlock.SetNull(); |
| 1022 | } |
| 1023 | } |
| 1024 | } |
| 1025 | |
| 1026 | void PeerManagerImpl::UpdateBlockAvailability(NodeId nodeid, const uint256 &hash) { |
| 1027 | CNodeState *state = State(nodeid); |
nothing calls this directly
no test coverage detected