| 256 | } |
| 257 | |
| 258 | void BlockManager::AddUnlinkedBlock(CBlockIndex* block) |
| 259 | { |
| 260 | AssertLockHeld(cs_main); |
| 261 | Assume(block != nullptr); |
| 262 | Assume(block->nStatus & BLOCK_HAVE_DATA); |
| 263 | auto range = m_blocks_unlinked.equal_range(block->pprev); |
| 264 | for (auto it = range.first; it != range.second; ++it) { |
| 265 | if (it->second == block) return; // don't insert duplicates |
| 266 | } |
| 267 | m_blocks_unlinked.emplace(block->pprev, block); |
| 268 | } |
| 269 | |
| 270 | void BlockManager::PruneOneBlockFile(const int fileNumber) |
| 271 | { |
no test coverage detected