Unverified Commit 5dbec9eb authored by kladko's avatar kladko

SKALE-3205

parent f0203c25
...@@ -66,7 +66,8 @@ void initUserSpace() { ...@@ -66,7 +66,8 @@ void initUserSpace() {
LevelDB::initDataFolderAndDBs(); LevelDB::initDataFolderAndDBs();
} }
void initEnclave(uint32_t _logLevel) { void initEnclave() {
#ifndef SGX_HW_SIM #ifndef SGX_HW_SIM
unsigned long support; unsigned long support;
...@@ -82,7 +83,14 @@ void initEnclave(uint32_t _logLevel) { ...@@ -82,7 +83,14 @@ void initEnclave(uint32_t _logLevel) {
sgx_status_t status = SGX_SUCCESS; sgx_status_t status = SGX_SUCCESS;
{ {
READ_LOCK(initMutex); WRITE_LOCK(initMutex);
if (eid != 0) {
if (sgx_destroy_enclave(eid) != SGX_SUCCESS) {
spdlog::error("Could not destroy enclave");
return;
}
}
eid = 0; eid = 0;
updated = 0; updated = 0;
...@@ -102,8 +110,7 @@ void initEnclave(uint32_t _logLevel) { ...@@ -102,8 +110,7 @@ void initEnclave(uint32_t _logLevel) {
spdlog::info("Enclave created and started successfully"); spdlog::info("Enclave created and started successfully");
status = trustedEnclaveInit(eid, logLevel);
status = trustedEnclaveInit(eid, _logLevel);
} }
if (status != SGX_SUCCESS) { if (status != SGX_SUCCESS) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment