MCPcopy Create free account
hub / github.com/ElementsProject/elements / ProcessBlockAvailability

Method ProcessBlockAvailability

src/net_processing.cpp:1011–1024  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1009}
1010
1011void 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
1026void PeerManagerImpl::UpdateBlockAvailability(NodeId nodeid, const uint256 &hash) {
1027 CNodeState *state = State(nodeid);

Callers

nothing calls this directly

Calls 4

LookupBlockIndexMethod · 0.80
StateEnum · 0.70
IsNullMethod · 0.45
SetNullMethod · 0.45

Tested by

no test coverage detected