| 53 | } |
| 54 | |
| 55 | bool BaseIndex::Init() |
| 56 | { |
| 57 | CBlockLocator locator; |
| 58 | if (!GetDB().ReadBestBlock(locator)) { |
| 59 | locator.SetNull(); |
| 60 | } |
| 61 | |
| 62 | LOCK(cs_main); |
| 63 | m_best_block_index = FindForkInGlobalIndex(chainActive, locator); |
| 64 | m_synced = m_best_block_index.load() == chainActive.Tip(); |
| 65 | return true; |
| 66 | } |
| 67 | |
| 68 | static const CBlockIndex* NextSyncBlock(const CBlockIndex* pindex_prev) |
| 69 | { |