From e5b1b7c5577ee36b5bcfb6c02b92da88455411e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C5=91rinc?= Date: Tue, 22 Jul 2025 10:19:36 -0700 Subject: [PATCH] refactor: rename `OBFUSCATION_KEY_KEY` See: https://github.com/bitcoin/bitcoin/pull/31144#discussion_r2216425882 Co-authored-by: Ryan Ofsky --- src/dbwrapper.cpp | 6 +++--- src/dbwrapper.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dbwrapper.cpp b/src/dbwrapper.cpp index b13699572c4..f43e07bc6bc 100644 --- a/src/dbwrapper.cpp +++ b/src/dbwrapper.cpp @@ -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()); diff --git a/src/dbwrapper.h b/src/dbwrapper.h index c5d49404861..b9b98bd96ad 100644 --- a/src/dbwrapper.h +++ b/src/dbwrapper.h @@ -189,7 +189,7 @@ private: Obfuscation m_obfuscation; //! obfuscation key storage key, null-prefixed to avoid collisions - inline static const std::string OBFUSCATION_KEY_KEY{"\000obfuscate_key", 14}; // explicit size to avoid truncation at leading \0 + inline static const std::string OBFUSCATION_KEY{"\000obfuscate_key", 14}; // explicit size to avoid truncation at leading \0 //! path to filesystem storage const fs::path m_path;