diff options
author | James O'Beirne <james.obeirne@gmail.com> | 2019-06-24 15:22:33 -0400 |
---|---|---|
committer | James O'Beirne <james.obeirne@gmail.com> | 2019-07-08 11:33:12 -0400 |
commit | 4ed55dfcd7894fd5ba6395f244a17ab1f8e786d4 (patch) | |
tree | 08cf711fb536abef170886660f3d5fa6ffd0592d /src/validation.h | |
parent | 613c46fe9e39f55b0f0daa18fee20b4120db2539 (diff) |
refactoring: add block_index_candidates arg to LoadBlockIndex
Prevents BlockManager from having to reference ChainstateActive()
within one of its methods which improves encapsulation and makes
testing easier.
Diffstat (limited to 'src/validation.h')
-rw-r--r-- | src/validation.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/validation.h b/src/validation.h index 09afbf7b10..ab18f662a4 100644 --- a/src/validation.h +++ b/src/validation.h @@ -475,9 +475,19 @@ public: */ std::multimap<CBlockIndex*, CBlockIndex*> m_blocks_unlinked; + /** + * Load the blocktree off disk and into memory. Populate certain metadata + * per index entry (nStatus, nChainWork, nTimeMax, etc.) as well as peripheral + * collections like setDirtyBlockIndex. + * + * @param[out] block_index_candidates Fill this set with any valid blocks for + * which we've downloaded all transactions. + */ bool LoadBlockIndex( const Consensus::Params& consensus_params, - CBlockTreeDB& blocktree) EXCLUSIVE_LOCKS_REQUIRED(cs_main); + CBlockTreeDB& blocktree, + std::set<CBlockIndex*, CBlockIndexWorkComparator>& block_index_candidates) + EXCLUSIVE_LOCKS_REQUIRED(cs_main); /** Clear all data members. */ void Unload() EXCLUSIVE_LOCKS_REQUIRED(cs_main); |