From 538fedde1d9c96a2bbe06cacc0cd6903135fbc83 Mon Sep 17 00:00:00 2001 From: Ryan Ofsky Date: Tue, 7 May 2024 08:52:55 -0400 Subject: common: Add ECC_Context RAII wrapper for ECC_Start/ECC_Stop --- src/key.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/key.cpp') diff --git a/src/key.cpp b/src/key.cpp index 2bd6396298..8f31146311 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -457,3 +457,13 @@ void ECC_Stop() { secp256k1_context_destroy(ctx); } } + +ECC_Context::ECC_Context() +{ + ECC_Start(); +} + +ECC_Context::~ECC_Context() +{ + ECC_Stop(); +} -- cgit v1.2.3