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

Method UpdatedBlockTip

src/validationinterface.cpp:188–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186 LogPrint(BCLog::VALIDATION, fmt "\n", __VA_ARGS__)
187
188void CMainSignals::UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) {
189 // Dependencies exist that require UpdatedBlockTip events to be delivered in the order in which
190 // the chain actually updates. One way to ensure this is for the caller to invoke this signal
191 // in the same critical section where the chain is updated
192
193 auto event = [pindexNew, pindexFork, fInitialDownload, this] {
194 m_internals->Iterate([&](CValidationInterface& callbacks) { callbacks.UpdatedBlockTip(pindexNew, pindexFork, fInitialDownload); });
195 };
196 ENQUEUE_AND_LOG_EVENT(event, "%s: new block hash=%s fork block hash=%s (in IBD=%s)", __func__,
197 pindexNew->GetBlockHash().ToString(),
198 pindexFork ? pindexFork->GetBlockHash().ToString() : "null",
199 fInitialDownload);
200}
201
202void CMainSignals::TransactionAddedToMempool(const CTransactionRef& tx, uint64_t mempool_sequence) {
203 auto event = [tx, mempool_sequence, this] {

Callers

nothing calls this directly

Calls 3

IterateMethod · 0.45
ToStringMethod · 0.45
GetBlockHashMethod · 0.45

Tested by

no test coverage detected