Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
This is needed for the next commit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[META] In a future commit, these options will be used in TestingSetup to
ensure that the DBs are in-memory.
|
|
Previously we were passing in CChainParams, when VerifyDB only needed
the Consensus::Params subset.
|
|
...instead allow optionally passing in a std::function<bool()>
|
|
...instead pass in a std::function<int64_t()>
Note that the static_cast is needed (apparently) for the compiler to
know which overloaded GetTime to choose.
|
|
...instead allow the caller to optionally pass in callbacks which are
triggered for certain events.
Behaviour change: The string "Verifying blocks..." was previously
printed for each chainstate in chainman which did not have an
effectively empty coinsview, now it will be printed once unconditionally
before we call VerifyLoadedChain.
|
|
|
|
...instead pass in only the necessary information
Also allow mempool to be a nullptr
|
|
...instead pass in only the necessary information
|
|
This allows us to separate the initialization code from translations and
error reporting.
This change changes the caller semantics of LoadChainstate quite
drastically.
To see that this change doesn't change behaviour, observe that:
1. Prior to this change, LoadChainstate returned false only in the "bad
genesis block" failure case (by returning InitError()), indicating
that the caller should immediately bail. After this change, the
corresponding ERROR_BAD_GENESIS_BLOCK handler in src/init.cpp
maintains behavioue by also bailing immediately.
2. The failed_* temporary booleans were only used to break out of the
outer do/while(false) loop. They can therefore be safely removed.
|
|
I strongly recommend reviewing with the following git-diff flags:
--color-moved=dimmed_zebra --color-moved-ws=allow-indentation-change
[META] This commit is intended to be as close to a move-only commit as
possible, and lingering ugliness will be resolved in subsequent
commits.
A few variables that are passed in by value instead of by reference
deserve explanation:
- fReset and fReindexChainstate are both local variables in AppInitMain
and are not modified in the sequence
- fPruneMode, despite being a global, is only modified in
AppInitParameterInteraction, long before LoadChainstate is called
----
[META] This semantic will change in a future commit named
"node/chainstate: Decouple from stringy errors"
|