mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-03 20:35:17 +02:00
kernel: De-globalize signature cache
Move its ownership to the ChainstateManager class. Next to simplifying usage of the kernel library by no longer requiring manual setup of the cache prior to using validation code, it also slims down the amount of memory allocated by BasicTestingSetup. Use this opportunity to make SignatureCache RAII styled Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
#include <kernel/chainstatemanager_opts.h>
|
||||
#include <kernel/checks.h>
|
||||
#include <kernel/context.h>
|
||||
#include <kernel/validation_cache_sizes.h>
|
||||
#include <kernel/warning.h>
|
||||
|
||||
#include <consensus/validation.h>
|
||||
@@ -63,12 +62,6 @@ int main(int argc, char* argv[])
|
||||
// properly
|
||||
assert(kernel::SanityChecks(kernel_context));
|
||||
|
||||
// Necessary for CheckInputScripts (eventually called by ProcessNewBlock),
|
||||
// which will try the script cache first and fall back to actually
|
||||
// performing the check with the signature cache.
|
||||
kernel::ValidationCacheSizes validation_cache_sizes{};
|
||||
Assert(InitSignatureCache(validation_cache_sizes.signature_cache_bytes));
|
||||
|
||||
ValidationSignals validation_signals{std::make_unique<util::ImmediateTaskRunner>()};
|
||||
|
||||
class KernelNotifications : public kernel::Notifications
|
||||
|
||||
Reference in New Issue
Block a user