refactor: Modernize logging in util/asmap.cpp
What changed, and why it matters
This commit is a minor code cleanup: it changes two logging calls in the asmap file handling from a general log function to a warning-level log function. There is no security-relevant behavior change, no bug fix, and no new vulnerability introduced.
No security action needed. Treat as routine refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch in src/util/asmap.cpp replaces two LogPrintf calls with LogWarning calls for ‘Failed to open asmap file from disk’ and ‘Sanity check of asmap file … failed’. This is purely a logging modernization/refactoring change. The control flow, return values, error handling, and file parsing logic are unchanged.
Changed components
src/util/asmap.cppInspect captured patch +2 / −2
diff --git a/src/util/asmap.cpp b/src/util/asmap.cpp
index bd685264..7c5f6eb5 100644
--- a/src/util/asmap.cpp
+++ b/src/util/asmap.cpp
@@ -200,7 +200,7 @@ std::vector<bool> DecodeAsmap(fs::path path)
FILE *filestr = fsbridge::fopen(path, "rb");
AutoFile file{filestr};
if (file.IsNull()) {
- LogPrintf("Failed to open asmap file from disk\n");
+ LogWarning("Failed to open asmap file from disk");
return bits;
}
file.seek(0, SEEK_END);
@@ -215,7 +215,7 @@ std::vector<bool> DecodeAsmap(fs::path path)
}
}
if (!SanityCheckASMap(bits, 128)) {
- LogPrintf("Sanity check of asmap file %s failed\n", fs::quoted(fs::PathToString(path)));
+ LogWarning("Sanity check of asmap file %s failed", fs::quoted(fs::PathToString(path)));
return {};
}
return bits;
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.