add ChainstateManager.GetSnapshot{BaseHeight,BaseBlock}()

For use in later commits.
This commit is contained in:
James O'Beirne
2021-10-28 16:59:18 -04:00
parent 73966f75f6
commit 5ee22cdafd
2 changed files with 20 additions and 0 deletions

View File

@@ -869,6 +869,13 @@ private:
/** Most recent headers presync progress update, for rate-limiting. */
std::chrono::time_point<std::chrono::steady_clock> m_last_presync_update GUARDED_BY(::cs_main) {};
//! Returns nullptr if no snapshot has been loaded.
const CBlockIndex* GetSnapshotBaseBlock() const EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
//! Return the height of the base block of the snapshot in use, if one exists, else
//! nullopt.
std::optional<int> GetSnapshotBaseHeight() const EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
public:
using Options = kernel::ChainstateManagerOpts;