@@ -46,16 +46,16 @@ static bool GetDataFromUnlockTx(const CTransaction& tx, CAmount& toUnlock, uint6
4646}
4747
4848namespace {
49- struct CreditPoolDataPerBlock {
50- CAmount credit_pool{0 };
51- CAmount unlocked{0 };
52- std::unordered_set<uint64_t > indexes;
53- };
49+ struct CreditPoolDataPerBlock {
50+ CAmount credit_pool{0 };
51+ CAmount unlocked{0 };
52+ std::unordered_set<uint64_t > indexes;
53+ };
5454} // anonymous namespace
5555
5656// it throws exception if anything went wrong
5757static std::optional<CreditPoolDataPerBlock> GetCreditDataFromBlock (const gsl::not_null<const CBlockIndex*> block_index,
58- const Consensus::Params& consensusParams)
58+ const Consensus::Params& consensusParams)
5959{
6060 // There's no CbTx before DIP0003 activation
6161 if (!DeploymentActiveAt (*block_index, Params ().GetConsensus (), Consensus::DEPLOYMENT_DIP0003)) {
@@ -65,7 +65,8 @@ static std::optional<CreditPoolDataPerBlock> GetCreditDataFromBlock(const gsl::n
6565 CreditPoolDataPerBlock blockData;
6666
6767 static Mutex cache_mutex;
68- static unordered_lru_cache<uint256, CreditPoolDataPerBlock, StaticSaltedHasher> block_data_cache GUARDED_BY (cache_mutex) {576 * 2 };
68+ static unordered_lru_cache<uint256, CreditPoolDataPerBlock, StaticSaltedHasher> block_data_cache GUARDED_BY (
69+ cache_mutex){576 * 2 };
6970 {
7071 LOCK (cache_mutex);
7172 if (block_data_cache.get (block_index->GetBlockHash (), blockData)) {
@@ -173,10 +174,12 @@ CCreditPool CCreditPoolManager::ConstructCreditPool(const gsl::not_null<const CB
173174 throw std::runtime_error (strprintf (" %s: failed-getcreditpool-index-duplicated" , __func__));
174175 }
175176
176- const CBlockIndex* distant_block_index{block_index->GetAncestor (block_index->nHeight - Params ().CreditPoolPeriodBlocks ())};
177+ const CBlockIndex* distant_block_index{
178+ block_index->GetAncestor (block_index->nHeight - Params ().CreditPoolPeriodBlocks ())};
177179 CAmount distantUnlocked{0 };
178180 if (distant_block_index) {
179- if (std::optional<CreditPoolDataPerBlock> distant_block{GetCreditDataFromBlock (distant_block_index, consensusParams)}; distant_block) {
181+ if (std::optional<CreditPoolDataPerBlock> distant_block{GetCreditDataFromBlock (distant_block_index, consensusParams)};
182+ distant_block) {
180183 distantUnlocked = distant_block->unlocked ;
181184 }
182185 }
@@ -198,8 +201,8 @@ CCreditPool CCreditPoolManager::ConstructCreditPool(const gsl::not_null<const CB
198201 LogPrint (BCLog::CREDITPOOL, /* Continued */
199202 " CCreditPoolManager: asset unlock limits on height: %d locked: %d.%08d limit: %d.%08d "
200203 " unlocked-in-window: %d.%08d\n " ,
201- block_index->nHeight , blockData.credit_pool / COIN, blockData.credit_pool % COIN, currentLimit / COIN, currentLimit % COIN,
202- latelyUnlocked / COIN, latelyUnlocked % COIN);
204+ block_index->nHeight , blockData.credit_pool / COIN, blockData.credit_pool % COIN, currentLimit / COIN,
205+ currentLimit % COIN, latelyUnlocked / COIN, latelyUnlocked % COIN);
203206 }
204207
205208 if (currentLimit < 0 ) {
0 commit comments