mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
validation: pass ChainstateRole for validationinterface calls
This allows consumers to decide how to handle events from background or assumedvalid chainstates.
This commit is contained in:
committed by
James O'Beirne
parent
1e59acdf17
commit
4d8f4dcb45
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <validation.h>
|
||||
|
||||
#include <kernel/chain.h>
|
||||
#include <kernel/coinstats.h>
|
||||
#include <kernel/mempool_persist.h>
|
||||
|
||||
@@ -2645,7 +2646,7 @@ bool Chainstate::FlushStateToDisk(
|
||||
}
|
||||
if (full_flush_completed) {
|
||||
// Update best block in wallet (so we can detect restored wallets).
|
||||
GetMainSignals().ChainStateFlushed(m_chain.GetLocator());
|
||||
GetMainSignals().ChainStateFlushed(this->GetRole(), m_chain.GetLocator());
|
||||
}
|
||||
} catch (const std::runtime_error& e) {
|
||||
return FatalError(m_chainman.GetNotifications(), state, std::string("System error while flushing: ") + e.what());
|
||||
@@ -3239,7 +3240,7 @@ bool Chainstate::ActivateBestChain(BlockValidationState& state, std::shared_ptr<
|
||||
|
||||
for (const PerBlockConnectTrace& trace : connectTrace.GetBlocksConnected()) {
|
||||
assert(trace.pblock && trace.pindex);
|
||||
GetMainSignals().BlockConnected(trace.pblock, trace.pindex);
|
||||
GetMainSignals().BlockConnected(this->GetRole(), trace.pblock, trace.pindex);
|
||||
}
|
||||
|
||||
// This will have been toggled in
|
||||
|
||||
Reference in New Issue
Block a user