Skip to content

Commit

Permalink
Only load signingActiveQuorumCount + 1 quorums into cache (bitcoin#3002)
Browse files Browse the repository at this point in the history
No need to load 25 quorums when we're scanning for the larger quorums which
only have 4 active quorums. This avoids loading thousands of masternode
lists unnecessarily.
  • Loading branch information
codablock committed Jul 2, 2019
1 parent 2dc1b06 commit 8d763c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/llmq/quorums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ std::vector<CQuorumCPtr> CQuorumManager::ScanQuorums(Consensus::LLMQType llmqTyp
auto& params = Params().GetConsensus().llmqs.at(llmqType);

auto cacheKey = std::make_pair(llmqType, pindexStart->GetBlockHash());
const size_t cacheMaxSize = 25; // largest active set + 1
const size_t cacheMaxSize = params.signingActiveQuorumCount + 1;

std::vector<CQuorumCPtr> result;

Expand Down

0 comments on commit 8d763c1

Please sign in to comment.