MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / WillDownloadFromNode

Function WillDownloadFromNode

src/main.cpp:5957–5973  ·  view source on GitHub ↗

If node is configured to avoid full block downloads, this will determine if we should skip downloading from this peer (for now)

Source from the content-addressed store, hash-verified

5955// If node is configured to avoid full block downloads,
5956// this will determine if we should skip downloading from this peer (for now)
5957bool WillDownloadFromNode(CNode* pto, const ThinBlockWorker& worker) {
5958
5959 // We always download full blocks during initial sync.
5960 if (IsInitialBlockDownload())
5961 return true;
5962
5963 // We don't mind full blocks.
5964 if (!Opt().UsingThinBlocks())
5965 return true;
5966
5967 if (!Opt().AvoidFullBlocks())
5968 return true;
5969
5970 // We want to download thin blocks only.
5971 return pto->SupportsXThinBlocks()
5972 || NodeStatePtr(pto->id)->supportsCompactBlocks;
5973}
5974
5975
5976bool SendMessages(CNode* pto)

Callers 1

SendMessagesFunction · 0.85

Calls 6

IsInitialBlockDownloadFunction · 0.85
OptClass · 0.85
NodeStatePtrClass · 0.85
UsingThinBlocksMethod · 0.80
AvoidFullBlocksMethod · 0.80
SupportsXThinBlocksMethod · 0.80

Tested by

no test coverage detected