Merge pull request #2303 from nspcc-dev/fix-uint160-sort-order

util: reverse the order of uint160 comparsion
This commit is contained in:
Roman Khimov 2021-12-07 15:52:01 +03:00 committed by GitHub
commit fae1d562e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}