Skip to content

Commit 56ea07f

Browse files
svanstaahodlinator
andauthored
add assertion for number of block filter indexes (currently just one)
Co-authored-by: hodlinator <172445034+hodlinator@users.noreply.github.com>
1 parent fa29acc commit 56ea07f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/node/caches.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ CacheSizes CalculateCacheSizes(const ArgsManager& args, size_t n_indexes)
7171
index_sizes.tx_index = std::min(total_cache * 10 / 100, args.GetBoolArg("-txindex", DEFAULT_TXINDEX) ? MAX_TX_INDEX_CACHE : 0);
7272
index_sizes.txospender_index = std::min(total_cache * 5 / 100, args.GetBoolArg("-txospenderindex", DEFAULT_TXOSPENDERINDEX) ? MAX_TXOSPENDER_INDEX_CACHE : 0);
7373
if (n_indexes > 0) {
74+
Assert(n_indexes == 1); // Currently only support one type of block filter index
7475
size_t max_cache = std::min(total_cache * 5 / 100, MAX_FILTER_INDEX_CACHE);
7576
index_sizes.filter_index = max_cache / n_indexes;
7677
total_cache -= index_sizes.filter_index * n_indexes;

0 commit comments

Comments
 (0)