Skip to content

Commit

Permalink
util: reverse the order of uint160 comparsion
Browse files Browse the repository at this point in the history
A follow-up to #2302, sort hashes using reverse order. Fixes
f9c68613f41ca85ddb01ec757153c0d86018d2324f6ff85a4afc708bb598b722 validation.

Hi, neo-project/neo#938.
  • Loading branch information
roman-khimov committed Dec 7, 2021
1 parent 673ea0d commit ef282e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/util/uint160.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit ef282e6

Please sign in to comment.