mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
init: Use size_t consistently for cache sizes
This avoids having to rely on implicit casts when passing them to the various functions allocating the caches. This also ensures that if the requested amount of db_cache does not fit in a size_t, it is clamped to the maximum value of a size_t. Also take this opportunity to make the total amounts of cache in the chainstate manager a size_t too.
This commit is contained in:
parent
65cde3621d
commit
2a92702baf
10 changed files with 38 additions and 29 deletions
|
|
@ -46,7 +46,7 @@ static ChainstateLoadResult CompleteChainstateInitialization(
|
|||
try {
|
||||
pblocktree = std::make_unique<BlockTreeDB>(DBParams{
|
||||
.path = chainman.m_options.datadir / "blocks" / "index",
|
||||
.cache_bytes = static_cast<size_t>(cache_sizes.block_tree_db),
|
||||
.cache_bytes = cache_sizes.block_tree_db,
|
||||
.memory_only = options.block_tree_db_in_memory,
|
||||
.wipe_data = options.wipe_block_tree_db,
|
||||
.options = chainman.m_options.block_tree_db});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue