refactor: rename OBFUSCATION_KEY_KEY

See: https://github.com/bitcoin/bitcoin/pull/31144#discussion_r2216425882

Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
This commit is contained in:
Lőrinc
2025-07-22 10:19:36 -07:00
parent 298bf95105
commit e5b1b7c557
2 changed files with 4 additions and 4 deletions

View File

@@ -250,10 +250,10 @@ CDBWrapper::CDBWrapper(const DBParams& params)
}
assert(!m_obfuscation); // Needed for unobfuscated Read()/Write() below
if (!Read(OBFUSCATION_KEY_KEY, m_obfuscation) && params.obfuscate && IsEmpty()) {
if (!Read(OBFUSCATION_KEY, m_obfuscation) && params.obfuscate && IsEmpty()) {
// Generate, write and read back the new obfuscation key, making sure we don't obfuscate the key itself
Write(OBFUSCATION_KEY_KEY, FastRandomContext{}.randbytes(Obfuscation::KEY_SIZE));
Read(OBFUSCATION_KEY_KEY, m_obfuscation);
Write(OBFUSCATION_KEY, FastRandomContext{}.randbytes(Obfuscation::KEY_SIZE));
Read(OBFUSCATION_KEY, m_obfuscation);
LogInfo("Wrote new obfuscation key for %s: %s", fs::PathToString(params.path), m_obfuscation.HexKey());
}
LogInfo("Using obfuscation key for %s: %s", fs::PathToString(params.path), m_obfuscation.HexKey());