checkpoint: check checkpoint instead of assuming

Change-Id: I51ea28759b85db5192117420685774147550947b
This commit is contained in:
bigbiff
2021-10-26 18:01:00 -04:00
parent 3d0a644462
commit c0228607f3
+1 -1
View File
@@ -174,7 +174,7 @@ static bool read_key(const std::string& metadata_key_dir, const KeyGeneration& g
unlink(newKeyPath.c_str());
}
bool needs_cp = cp_needsCheckpoint();
if (!retrieveOrGenerateKey(dir, temp, kEmptyAuthentication, gen, key, true)) return false;
if (!retrieveOrGenerateKey(dir, temp, kEmptyAuthentication, gen, key, needs_cp)) return false;
if (needs_cp && pathExists(newKeyPath)) std::thread(commit_key, dir).detach();
return true;
}