| 409 | std::shared_ptr<KernelValidationInterface> m_validation_interface; |
| 410 | |
| 411 | Context(const ContextOptions* options, bool& sane) |
| 412 | : m_context{std::make_unique<kernel::Context>()}, |
| 413 | m_interrupt{std::make_unique<util::SignalInterrupt>()} |
| 414 | { |
| 415 | if (options) { |
| 416 | LOCK(options->m_mutex); |
| 417 | if (options->m_chainparams) { |
| 418 | m_chainparams = std::make_unique<const CChainParams>(*options->m_chainparams); |
| 419 | } |
| 420 | if (options->m_notifications) { |
| 421 | m_notifications = options->m_notifications; |
| 422 | } |
| 423 | if (options->m_validation_interface) { |
| 424 | m_signals = std::make_unique<ValidationSignals>(std::make_unique<ImmediateTaskRunner>()); |
| 425 | m_validation_interface = options->m_validation_interface; |
| 426 | m_signals->RegisterSharedValidationInterface(m_validation_interface); |
| 427 | } |
| 428 | } |
| 429 | |
| 430 | if (!m_chainparams) { |
| 431 | m_chainparams = CChainParams::Main(); |
| 432 | } |
| 433 | if (!m_notifications) { |
| 434 | m_notifications = std::make_shared<KernelNotifications>(btck_NotificationInterfaceCallbacks{ |
| 435 | nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}); |
| 436 | } |
| 437 | |
| 438 | if (!kernel::SanityChecks(*m_context)) { |
| 439 | sane = false; |
| 440 | } |
| 441 | } |
| 442 | |
| 443 | ~Context() |
| 444 | { |
nothing calls this directly
no test coverage detected