Reorder preferred hash list

This commit is contained in:
comp500 2022-02-14 16:53:34 +00:00
parent 6bb15f593b
commit 9585272311

View File

@ -317,7 +317,11 @@ func shouldDownloadOnSide(side string) bool {
func (v VersionFile) getBestHash() (string, string) {
//try preferred hashes first
val, exists := v.Hashes["sha256"]
val, exists := v.Hashes["sha512"]
if exists {
return "sha512", val
}
val, exists = v.Hashes["sha256"]
if exists {
return "sha256", val
}
@ -325,10 +329,6 @@ func (v VersionFile) getBestHash() (string, string) {
if exists {
return "murmur2", val
}
val, exists = v.Hashes["sha512"]
if exists {
return "sha512", val
}
//none of the preferred hashes are present, just get the first one
for key, val := range v.Hashes {