| 356 | } |
| 357 | |
| 358 | uint256 GetOrphanRoot(const uint256 &hash) { |
| 359 | map<uint256, COrphanBlock *>::iterator it = mapOrphanBlocks.find(hash); |
| 360 | if (it == mapOrphanBlocks.end()) |
| 361 | return hash; |
| 362 | |
| 363 | // Work back to the first block in the orphan chain |
| 364 | do { |
| 365 | map<uint256, COrphanBlock *>::iterator it2 = mapOrphanBlocks.find(it->second->prevBlockHash); |
| 366 | if (it2 == mapOrphanBlocks.end()) |
| 367 | return it->first; |
| 368 | it = it2; |
| 369 | } while (true); |
| 370 | } |
| 371 | |
| 372 | // Remove a random orphan block (which does not have any dependent orphans). |
| 373 | bool static PruneOrphanBlocks(int32_t height) { |
no test coverage detected