SKALE-2835 fix deleting bls keys

parent 4342c5d6
...@@ -637,7 +637,6 @@ Json::Value SGXWalletServer::isPolyExistsImpl(const string &_polyName) { ...@@ -637,7 +637,6 @@ Json::Value SGXWalletServer::isPolyExistsImpl(const string &_polyName) {
Json::Value SGXWalletServer::getServerStatusImpl() { Json::Value SGXWalletServer::getServerStatusImpl() {
INIT_RESULT(result) INIT_RESULT(result)
return result; return result;
} }
...@@ -659,13 +658,13 @@ Json::Value SGXWalletServer::deleteBlsKeyImpl(const std::string& name) { ...@@ -659,13 +658,13 @@ Json::Value SGXWalletServer::deleteBlsKeyImpl(const std::string& name) {
std::shared_ptr <std::string> bls_ptr = LevelDB::getLevelDb()->readString(key); std::shared_ptr <std::string> bls_ptr = LevelDB::getLevelDb()->readString(key);
if (bls_ptr != nullptr) { if (bls_ptr != nullptr) {
LevelDB::getLevelDb()->deleteKey(name);
result["deleted"] = true; result["deleted"] = true;
return result; return result;
} else { } else {
std::string error_msg = "BLS key with such name not found: " + name; std::string error_msg = "BLS key with such name not found: " + name;
throw SGXException(INVALID_BLS_NAME, error_msg.c_str()); throw SGXException(INVALID_BLS_NAME, error_msg.c_str());
} }
LevelDB::getLevelDb()->deleteKey(name);
} HANDLE_SGX_EXCEPTION(result) } HANDLE_SGX_EXCEPTION(result)
return result; return result;
} }
......
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