perf(startup): stat dragonxd instead of reading it for the update offer
On Windows every full-node launch read the whole installed dragonxd.exe (about 16.7 MB) on the UI thread and byte-scanned it for a version string, to decide whether to offer the bundled node, which only needs whether the file exists and its size. getInstalledDaemonInfo() takes a scanVersion flag, and the update offer now only stats the file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -663,7 +663,7 @@ static std::string scanBinaryVersion(const uint8_t* data, std::size_t size)
|
||||
return "";
|
||||
}
|
||||
|
||||
DaemonBinaryInfo getInstalledDaemonInfo()
|
||||
DaemonBinaryInfo getInstalledDaemonInfo(bool scanVersion)
|
||||
{
|
||||
DaemonBinaryInfo info;
|
||||
std::string daemonDir = getDaemonDirectory();
|
||||
@@ -688,6 +688,7 @@ DaemonBinaryInfo getInstalledDaemonInfo()
|
||||
}
|
||||
|
||||
// Read the binary and scan for its version stamp (one-off; caller caches the result).
|
||||
if (!scanVersion) return info;
|
||||
std::ifstream f(info.path, std::ios::binary);
|
||||
if (f) {
|
||||
f.seekg(0, std::ios::end);
|
||||
|
||||
Reference in New Issue
Block a user