| 226 | } |
| 227 | |
| 228 | bool BaseIndex::BlockUntilSyncedToCurrentChain() |
| 229 | { |
| 230 | AssertLockNotHeld(cs_main); |
| 231 | |
| 232 | if (!m_synced) { |
| 233 | return false; |
| 234 | } |
| 235 | |
| 236 | { |
| 237 | // Skip the queue-draining stuff if we know we're caught up with |
| 238 | // chainActive.Tip(). |
| 239 | LOCK(cs_main); |
| 240 | const CBlockIndex* chain_tip = chainActive.Tip(); |
| 241 | const CBlockIndex* best_block_index = m_best_block_index.load(); |
| 242 | if (best_block_index->GetAncestor(chain_tip->nHeight) == chain_tip) { |
| 243 | return true; |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | LogPrintf("%s: %s is catching up on block notifications\n", __func__, GetName()); |
| 248 | SyncWithValidationInterfaceQueue(); |
| 249 | return true; |
| 250 | } |
| 251 | |
| 252 | void BaseIndex::Interrupt() |
| 253 | { |