refactor: Unify asmap version calculation and naming

Calculate the asmap version only in one place: A dedicated function in util/asmap.

The version was also referred to as asmap checksum in several places. To avoid confusion call it asmap version everywhere.
This commit is contained in:
Fabian Jahr
2025-04-22 23:44:06 +02:00
parent fa41fc6a1a
commit 385c34a052
6 changed files with 27 additions and 15 deletions

View File

@@ -1581,7 +1581,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
InitError(strprintf(_("Could not parse asmap file %s"), fs::quoted(fs::PathToString(asmap_path))));
return false;
}
const uint256 asmap_version = (HashWriter{} << asmap).GetHash();
const uint256 asmap_version = AsmapVersion(asmap);;
LogInfo("Using asmap version %s for IP bucketing", asmap_version.ToString());
} else {
LogInfo("Using /16 prefix for IP bucketing");