Unverified Commit ddb89c83 authored by Stan Kladko's avatar Stan Kladko Committed by GitHub

Merge pull request #179 from skalenetwork/SKALE-3274

SKALE-3274-restart-enclave
parents b676e9f8 8733da4c
......@@ -210,7 +210,6 @@ void gen_SEK() {
}
void reinitEnclave() {
WRITE_LOCK(initMutex);
// unfortunately process needs to be restarted to reinit enclave
// exiting with error code 3 (SGX_OUT_OF_MEMORY), so docker container can restart the
// wallet
......
......@@ -119,23 +119,23 @@ READ_LOCK(initMutex);
#define RESTART_END \
} \
if (status != SGX_SUCCESS || errStatus != 0) { \
if (status != SGX_SUCCESS || errStatus == 3) { \
spdlog::error(__FUNCTION__); \
spdlog::error("Restarting sgx on status errStatus... {} {}", status, errStatus); \
reinitEnclave(); \
} \
} while ((status != SGX_SUCCESS || errStatus != 0) && __ATTEMPTS__ < 2);
} while ((status != SGX_SUCCESS || errStatus == 3) && __ATTEMPTS__ < 2);
#define RESTART_END_POINTER \
} \
if (status != SGX_SUCCESS || *errStatus != 0) { \
if (status != SGX_SUCCESS || *errStatus == 3) { \
spdlog::error(__FUNCTION__);\
spdlog::error("Restarting sgx on status errStatus... {} {}", status, *errStatus); \
reinitEnclave(); \
} \
} while ((status != SGX_SUCCESS || *errStatus != 0) && __ATTEMPTS__ < 2);
} while ((status != SGX_SUCCESS || *errStatus == 3) && __ATTEMPTS__ < 2);
......
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