Requires cs_main. Returns a bool indicating whether we requested this block.
| 305 | // Requires cs_main. |
| 306 | // Returns a bool indicating whether we requested this block. |
| 307 | bool 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 | |
| 322 | struct MarkBlockAsInFlight : public BlockInFlightMarker { |
| 323 |
no test coverage detected