mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-06 11:13:02 +02:00
refactor: De-globalize g_signals
This commit is contained in:
@@ -89,7 +89,7 @@ bool BaseIndex::Init()
|
||||
return &m_chain->context()->chainman->GetChainstateForIndexing());
|
||||
// Register to validation interface before setting the 'm_synced' flag, so that
|
||||
// callbacks are not missed once m_synced is true.
|
||||
RegisterValidationInterface(this);
|
||||
m_chain->context()->validation_signals->RegisterValidationInterface(this);
|
||||
|
||||
CBlockLocator locator;
|
||||
if (!GetDB().ReadBestBlock(locator)) {
|
||||
@@ -380,7 +380,7 @@ bool BaseIndex::BlockUntilSyncedToCurrentChain() const
|
||||
}
|
||||
|
||||
LogPrintf("%s: %s is catching up on block notifications\n", __func__, GetName());
|
||||
SyncWithValidationInterfaceQueue();
|
||||
m_chain->context()->validation_signals->SyncWithValidationInterfaceQueue();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -399,7 +399,9 @@ bool BaseIndex::StartBackgroundSync()
|
||||
|
||||
void BaseIndex::Stop()
|
||||
{
|
||||
UnregisterValidationInterface(this);
|
||||
if (m_chain->context()->validation_signals) {
|
||||
m_chain->context()->validation_signals->UnregisterValidationInterface(this);
|
||||
}
|
||||
|
||||
if (m_thread_sync.joinable()) {
|
||||
m_thread_sync.join();
|
||||
|
||||
Reference in New Issue
Block a user