aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/context.cpp')
-rw-r--r--src/kernel/context.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/kernel/context.cpp b/src/kernel/context.cpp
index 1205da869e..3f4a423531 100644
--- a/src/kernel/context.cpp
+++ b/src/kernel/context.cpp
@@ -14,9 +14,12 @@
namespace kernel {
+Context* g_context;
Context::Context()
{
+ assert(!g_context);
+ g_context = this;
std::string sha256_algo = SHA256AutoDetect();
LogPrintf("Using the '%s' SHA256 implementation\n", sha256_algo);
RandomInit();
@@ -26,6 +29,8 @@ Context::Context()
Context::~Context()
{
ECC_Stop();
+ assert(g_context);
+ g_context = nullptr;
}
} // namespace kernel