mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02: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:
parent
1e59acdf17
commit
4d8f4dcb45
19 changed files with 66 additions and 42 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue