MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / operator()

Method operator()

src/main.cpp:324–337  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

322struct MarkBlockAsInFlight : public BlockInFlightMarker {
323
324 void operator()(NodeId nodeid, const uint256& hash, const Consensus::Params& consensusParams, CBlockIndex *pindex = NULL) {
325 AssertLockHeld(cs_main);
326
327 NodeStatePtr state(nodeid);
328 assert(!state.IsNull());
329
330 int64_t nNow = GetTimeMicros();
331 QueuedBlock newentry = {hash, pindex, nNow, pindex != NULL, GetBlockTimeout(nNow, nQueuedValidatedHeaders, consensusParams), nodeid};
332 nQueuedValidatedHeaders += newentry.fValidatedHeaders;
333 list<QueuedBlock>::iterator it = state->vBlocksInFlight.insert(state->vBlocksInFlight.end(), newentry);
334 state->nBlocksInFlight++;
335 state->nBlocksInFlightValidHeaders += newentry.fValidatedHeaders;
336 blocksInFlight.insert(it);
337 };
338};
339
340/** Check whether the last unknown block a peer advertized is not yet known. */

Callers

nothing calls this directly

Calls 5

GetTimeMicrosFunction · 0.85
GetBlockTimeoutFunction · 0.85
IsNullMethod · 0.45
insertMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected