File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -5365,3 +5365,16 @@ bool IsBIP30Unspendable(const CBlockIndex& block_index)
5365
5365
return (block_index.nHeight ==91722 && block_index.GetBlockHash () == uint256S (" 0x00000000000271a2dc26e7667f8419f2e15416dc6955e5a6c6cdf3f2574dd08e" )) ||
5366
5366
(block_index.nHeight ==91812 && block_index.GetBlockHash () == uint256S (" 0x00000000000af0aed4792b1acee3d966af36cf5def14935db8de83d6f9306f2f" ));
5367
5367
}
5368
+
5369
+ const CBlockIndex* ChainstateManager::GetSnapshotBaseBlock () const
5370
+ {
5371
+ const auto blockhash_op = this ->SnapshotBlockhash ();
5372
+ if (!blockhash_op) return nullptr ;
5373
+ return Assert (m_blockman.LookupBlockIndex (*blockhash_op));
5374
+ }
5375
+
5376
+ std::optional<int > ChainstateManager::GetSnapshotBaseHeight () const
5377
+ {
5378
+ const CBlockIndex* base = this ->GetSnapshotBaseBlock ();
5379
+ return base ? std::make_optional (base->nHeight ) : std::nullopt;
5380
+ }
Original file line number Diff line number Diff line change @@ -869,6 +869,13 @@ class ChainstateManager
869
869
/* * Most recent headers presync progress update, for rate-limiting. */
870
870
std::chrono::time_point<std::chrono::steady_clock> m_last_presync_update GUARDED_BY (::cs_main) {};
871
871
872
+ // ! Returns nullptr if no snapshot has been loaded.
873
+ const CBlockIndex* GetSnapshotBaseBlock () const EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
874
+
875
+ // ! Return the height of the base block of the snapshot in use, if one exists, else
876
+ // ! nullopt.
877
+ std::optional<int > GetSnapshotBaseHeight () const EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
878
+
872
879
public:
873
880
using Options = kernel::ChainstateManagerOpts;
874
881
You can’t perform that action at this time.
0 commit comments