From 0b06bc3a5d7709403cf6ac97117d55cf3c478c01 Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Fri, 20 Oct 2023 14:53:53 +0800 Subject: [PATCH] not compare strings in func CompareSignersLists --- consensus/XDPoS/utils/utils.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/consensus/XDPoS/utils/utils.go b/consensus/XDPoS/utils/utils.go index 42c7fa8946..1b4e816dd1 100644 --- a/consensus/XDPoS/utils/utils.go +++ b/consensus/XDPoS/utils/utils.go @@ -68,10 +68,10 @@ func CompareSignersLists(list1 []common.Address, list2 []common.Address) bool { } sort.Slice(l1, func(i, j int) bool { - return l1[i].String() <= l1[j].String() + return bytes.Compare(l1[i][:], l1[j][:]) == -1 }) sort.Slice(l2, func(i, j int) bool { - return l2[i].String() <= l2[j].String() + return bytes.Compare(l2[i][:], l2[j][:]) == -1 }) return reflect.DeepEqual(l1, l2) }