Changeset View
Changeset View
Standalone View
Standalone View
src/pow/aserti32d.cpp
Show All 10 Lines | |||||
#include <atomic> | #include <atomic> | ||||
static std::atomic<const CBlockIndex *> cachedAnchor{nullptr}; | static std::atomic<const CBlockIndex *> cachedAnchor{nullptr}; | ||||
void ResetASERTAnchorBlockCache() noexcept { | void ResetASERTAnchorBlockCache() noexcept { | ||||
cachedAnchor = nullptr; | cachedAnchor = nullptr; | ||||
} | } | ||||
const CBlockIndex *GetASERTAnchorBlockCache() noexcept { | |||||
return cachedAnchor.load(); | |||||
} | |||||
/** | /** | ||||
* Returns a pointer to the anchor block used for ASERT. | * Returns a pointer to the anchor block used for ASERT. | ||||
* As anchor we use the first block for which IsAxionEnabled() returns true. | * As anchor we use the first block for which IsAxionEnabled() returns true. | ||||
* This block happens to be the last block which was mined under the old DAA | * This block happens to be the last block which was mined under the old DAA | ||||
* rules. | * rules. | ||||
* | * | ||||
* This function is meant to be removed some time after the upgrade, once | * This function is meant to be removed some time after the upgrade, once | ||||
* the anchor block is deeply buried, and behind a hard-coded checkpoint. | * the anchor block is deeply buried, and behind a hard-coded checkpoint. | ||||
▲ Show 20 Lines • Show All 220 Lines • Show Last 20 Lines |