From 33c48c106cf03ff62994ff5777a775982d90eab9 Mon Sep 17 00:00:00 2001 From: TheCharlatan Date: Wed, 3 Jul 2024 22:34:01 +0200 Subject: [PATCH] validation: Check if mempool exists before asserting in ActivateSnapshot --- src/validation.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/validation.cpp b/src/validation.cpp index 7b586c45b8..5002b1b906 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -5681,7 +5681,8 @@ util::Result ChainstateManager::ActivateSnapshot( return util::Error{strprintf(_("The base block header (%s) is part of an invalid chain."), base_blockhash.ToString())}; } - if (Assert(m_active_chainstate->GetMempool())->size() > 0) { + auto mempool{m_active_chainstate->GetMempool()}; + if (mempool && mempool->size() > 0) { return util::Error{_("Can't activate a snapshot when mempool not empty.")}; } }