MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / BlockUntilSyncedToCurrentChain

Method BlockUntilSyncedToCurrentChain

src/index/base.cpp:430–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

428}
429
430bool BaseIndex::BlockUntilSyncedToCurrentChain() const
431{
432 AssertLockNotHeld(cs_main);
433
434 if (!m_synced) {
435 return false;
436 }
437
438 {
439 // Skip the queue-draining stuff if we know we're caught up with
440 // m_chain.Tip().
441 LOCK(cs_main);
442 const CBlockIndex* chain_tip = m_chainstate->m_chain.Tip();
443 const CBlockIndex* best_block_index = m_best_block_index.load();
444 if (best_block_index->GetAncestor(chain_tip->nHeight) == chain_tip) {
445 return true;
446 }
447 }
448
449 LogInfo("%s is catching up on block notifications", GetName());
450 m_chain->context()->validation_signals->SyncWithValidationInterfaceQueue();
451 return true;
452}
453
454void BaseIndex::Interrupt()
455{

Callers 14

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
BOOST_FIXTURE_TEST_CASEFunction · 0.45
gettxoutproofFunction · 0.45
gettxspendingprevoutFunction · 0.45
ProcessPSBTFunction · 0.45
getrawtransactionFunction · 0.45
gettxoutsetinfoFunction · 0.45

Calls 5

TipMethod · 0.45
loadMethod · 0.45
GetAncestorMethod · 0.45
contextMethod · 0.45

Tested by 4

BOOST_FIXTURE_TEST_CASEFunction · 0.36
BOOST_FIXTURE_TEST_CASEFunction · 0.36
BOOST_FIXTURE_TEST_CASEFunction · 0.36
BOOST_FIXTURE_TEST_CASEFunction · 0.36