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

Function MarkBlockAsReceived

src/main.cpp:307–320  ·  view source on GitHub ↗

Requires cs_main. Returns a bool indicating whether we requested this block.

Source from the content-addressed store, hash-verified

305// Requires cs_main.
306// Returns a bool indicating whether we requested this block.
307bool MarkBlockAsReceived(const uint256& hash) {
308 AssertLockHeld(cs_main);
309 if (!blocksInFlight.isInFlight(hash))
310 return false;
311
312 std::vector<QueuedBlockPtr> queued = blocksInFlight.queuedPtrsFor(hash);
313 typedef std::vector<QueuedBlockPtr>::const_iterator auto_;
314 for (auto_ q = queued.begin(); q != queued.end(); ++q) {
315 InFlightEraserImpl erase;
316 erase((*q)->node, hash);
317 }
318 thinblockmg.removeIfExists(hash);
319 return !queued.empty();
320}
321
322struct MarkBlockAsInFlight : public BlockInFlightMarker {
323

Callers 1

ProcessNewBlockFunction · 0.85

Calls 6

queuedPtrsForMethod · 0.80
removeIfExistsMethod · 0.80
isInFlightMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected