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

Method BlockUntilSyncedToCurrentChain

src/index/base.cpp:228–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228bool 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
252void BaseIndex::Interrupt()
253{

Callers 4

rest_txFunction · 0.45
BOOST_FIXTURE_TEST_CASEFunction · 0.45
getrawtransactionFunction · 0.45
gettxoutproofFunction · 0.45

Calls 3

GetAncestorMethod · 0.80
TipMethod · 0.45

Tested by 1

BOOST_FIXTURE_TEST_CASEFunction · 0.36