wallet: Rename `RecordType::DELETE` to `RecordType::DELETE_FLAG`
What changed, and why it matters
This is a straightforward code cleanup change that renames an internal label from DELETE to DELETE_FLAG. It fixes a build problem on Windows where a system header also uses the word DELETE, which could cause compilation errors depending on the order headers were included. There is no security vulnerability or runtime behavior change.
No security action needed. Treat as normal build-compatibility cleanup.
Security signals we found
No security-relevant signal present
Change is a symbol rename with identical semantics
Evidence from the diff
The commit renames the RecordType enumerator DELETE to DELETE_FLAG in src/wallet/migrate.cpp and updates all references. The change is purely cosmetic/preventive: the numeric value (0x80) and all logic using it remain identical. It removes a macro collision with Windows’ winnt.h header, which defines DELETE as 0x00010000L. This avoids potential preprocessor expansion that could turn the enumerator name into a numeric literal and break compilation.
Changed components
src/wallet/migrate.cppBDB wallet migration codeInspect captured patch +5 / −5
diff --git a/src/wallet/migrate.cpp b/src/wallet/migrate.cpp
index 1f6e4e85..1869a456 100644
--- a/src/wallet/migrate.cpp
+++ b/src/wallet/migrate.cpp
@@ -50,7 +50,7 @@ enum class RecordType : uint8_t {
KEYDATA = 1,
// DUPLICATE = 2, Unused as our databases do not support duplicate records
OVERFLOW_DATA = 3,
- DELETE = 0x80, // Indicate this record is deleted. This is OR'd with the real type.
+ DELETE_FLAG = 0x80, // Indicate this record is deleted. This is OR'd with the real type.
};
enum class BTreeFlags : uint32_t {
@@ -208,8 +208,8 @@ class RecordHeader
{
public:
uint16_t len; // Key/data item length
- RecordType type; // Page type (BDB has this include a DELETE FLAG that we track separately)
- bool deleted; // Whether the DELETE flag was set on type
+ RecordType type; // Page type (BDB has this; includes a DELETE_FLAG that we track separately)
+ bool deleted; // Whether the DELETE_FLAG was set on type
static constexpr size_t SIZE = 3; // The record header is 3 bytes
@@ -225,8 +225,8 @@ public:
uint8_t uint8_type;
s >> uint8_type;
- type = static_cast<RecordType>(uint8_type & ~static_cast<uint8_t>(RecordType::DELETE));
- deleted = uint8_type & static_cast<uint8_t>(RecordType::DELETE);
+ type = static_cast<RecordType>(uint8_type & ~static_cast<uint8_t>(RecordType::DELETE_FLAG));
+ deleted = uint8_type & static_cast<uint8_t>(RecordType::DELETE_FLAG);
if (other_endian) {
len = internal_bswap_16(len);
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.