| 351 | } |
| 352 | |
| 353 | bool BaseIndex::Start(CChainState& active_chainstate) |
| 354 | { |
| 355 | m_chainstate = &active_chainstate; |
| 356 | // Need to register this ValidationInterface before running Init(), so that |
| 357 | // callbacks are not missed if Init sets m_synced to true. |
| 358 | RegisterValidationInterface(this); |
| 359 | if (!Init()) { |
| 360 | return false; |
| 361 | } |
| 362 | |
| 363 | m_thread_sync = std::thread(&util::TraceThread, GetName(), [this] { ThreadSync(); }); |
| 364 | return true; |
| 365 | } |
| 366 | |
| 367 | void BaseIndex::Stop() |
| 368 | { |