Requires cs_main.
| 392 | |
| 393 | // Requires cs_main. |
| 394 | void MarkBlockAsReceived(const uint256& hash) |
| 395 | { |
| 396 | map<uint256, pair<NodeId, list<QueuedBlock>::iterator> >::iterator itInFlight = mapBlocksInFlight.find(hash); |
| 397 | if (itInFlight != mapBlocksInFlight.end()) { |
| 398 | CNodeState* state = State(itInFlight->second.first); |
| 399 | nQueuedValidatedHeaders -= itInFlight->second.second->fValidatedHeaders; |
| 400 | state->vBlocksInFlight.erase(itInFlight->second.second); |
| 401 | state->nBlocksInFlight--; |
| 402 | state->nStallingSince = 0; |
| 403 | mapBlocksInFlight.erase(itInFlight); |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | // Requires cs_main. |
| 408 | // returns false, still setting pit, if the block was already in flight from the same peer |
no test coverage detected