From ef282e6cb77144fa7ecee694950bec6cf876d446 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Tue, 7 Dec 2021 15:19:55 +0300 Subject: [PATCH] util: reverse the order of uint160 comparsion A follow-up to #2302, sort hashes using reverse order. Fixes f9c68613f41ca85ddb01ec757153c0d86018d2324f6ff85a4afc708bb598b722 validation. Hi, neo-project/neo#938. --- pkg/util/uint160.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/util/uint160.go b/pkg/util/uint160.go index 1e457d323..6e40c73d9 100644 --- a/pkg/util/uint160.go +++ b/pkg/util/uint160.go @@ -107,7 +107,7 @@ func (u Uint160) Equals(other Uint160) bool { // Less returns true if this value is less than given Uint160 value. It's // primarily intended to be used for sorting purposes. func (u Uint160) Less(other Uint160) bool { - for k := range u { + for k := Uint160Size - 1; k >= 0; k-- { if u[k] == other[k] { continue }