| 35 | } |
| 36 | |
| 37 | void FinalizeNode(NodeId nodeid) { |
| 38 | LOCK(cs_mapNodeState); |
| 39 | CNodeState *state = State(nodeid); |
| 40 | |
| 41 | for (const auto &entry : state->vBlocksInFlight) |
| 42 | mapBlocksInFlight.erase(entry.hash); |
| 43 | |
| 44 | for (const auto &hash : state->vBlocksToDownload) |
| 45 | mapBlocksToDownload.erase(hash); |
| 46 | |
| 47 | mapNodeState.erase(nodeid); |
| 48 | } |
| 49 | |
| 50 | // Requires cs_mapNodeState. |
| 51 | CNodeState *State(NodeId pNode) { |