MCPcopy Create free account
hub / github.com/ElementsProject/elements / BlockUntilSyncedToCurrentChain

Method BlockUntilSyncedToCurrentChain

src/index/base.cpp:324–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

322}
323
324bool BaseIndex::BlockUntilSyncedToCurrentChain() const
325{
326 AssertLockNotHeld(cs_main);
327
328 if (!m_synced) {
329 return false;
330 }
331
332 {
333 // Skip the queue-draining stuff if we know we're caught up with
334 // m_chain.Tip().
335 LOCK(cs_main);
336 const CBlockIndex* chain_tip = m_chainstate->m_chain.Tip();
337 const CBlockIndex* best_block_index = m_best_block_index.load();
338 if (best_block_index->GetAncestor(chain_tip->nHeight) == chain_tip) {
339 return true;
340 }
341 }
342
343 LogPrintf("%s: %s is catching up on block notifications\n", __func__, GetName());
344 SyncWithValidationInterfaceQueue();
345 return true;
346}
347
348void BaseIndex::Interrupt()
349{

Callers 10

rest_filter_headerFunction · 0.45
rest_block_filterFunction · 0.45
rest_txFunction · 0.45
BOOST_FIXTURE_TEST_CASEFunction · 0.45
BOOST_FIXTURE_TEST_CASEFunction · 0.45
BOOST_FIXTURE_TEST_CASEFunction · 0.45
getrawtransactionFunction · 0.45
gettxoutproofFunction · 0.45
gettxoutsetinfoFunction · 0.45
getblockfilterFunction · 0.45

Calls 4

GetAncestorMethod · 0.80
TipMethod · 0.45
loadMethod · 0.45

Tested by 3

BOOST_FIXTURE_TEST_CASEFunction · 0.36
BOOST_FIXTURE_TEST_CASEFunction · 0.36
BOOST_FIXTURE_TEST_CASEFunction · 0.36