MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / IsAncestorOfBestHeaderOrTip

Method IsAncestorOfBestHeaderOrTip

src/net_processing.cpp:2841–2851  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2839}
2840
2841bool PeerManagerImpl::IsAncestorOfBestHeaderOrTip(const CBlockIndex* header)
2842{
2843 if (header == nullptr) {
2844 return false;
2845 } else if (m_chainman.m_best_header != nullptr && header == m_chainman.m_best_header->GetAncestor(header->nHeight)) {
2846 return true;
2847 } else if (m_chainman.ActiveChain().Contains(*header)) {
2848 return true;
2849 }
2850 return false;
2851}
2852
2853bool PeerManagerImpl::MaybeSendGetHeaders(CNode& pfrom, const CBlockLocator& locator, Peer& peer)
2854{

Callers

nothing calls this directly

Calls 2

GetAncestorMethod · 0.45
ContainsMethod · 0.45

Tested by

no test coverage detected