kernel: Move default cache constants to caches

They are not related to the txdb, so a better place for them is the
new kernel and node cache file. Re-use the default amount of kernel
cache for the default node cache.
This commit is contained in:
TheCharlatan
2024-11-22 22:52:02 +01:00
parent 8826cae285
commit 65cde3621d
8 changed files with 18 additions and 16 deletions

View File

@@ -19,9 +19,9 @@
#include <consensus/validation.h>
#include <core_io.h>
#include <kernel/caches.h>
#include <logging.h>
#include <node/blockstorage.h>
#include <node/caches.h>
#include <node/chainstate.h>
#include <random.h>
#include <script/sigcache.h>
@@ -123,7 +123,7 @@ int main(int argc, char* argv[])
util::SignalInterrupt interrupt;
ChainstateManager chainman{interrupt, chainman_opts, blockman_opts};
kernel::CacheSizes cache_sizes{nDefaultDbCache << 20};
kernel::CacheSizes cache_sizes{DEFAULT_KERNEL_CACHE << 20};
node::ChainstateLoadOptions options;
auto [status, error] = node::LoadChainstate(chainman, cache_sizes, options);
if (status != node::ChainstateLoadStatus::SUCCESS) {