common: improve function ExtractAddressFromBytes, close XFN-15 (#1658)

This commit is contained in:
Daniel Liu 2025-11-03 15:26:14 +08:00 committed by benjamin202410
parent 8ed7b1cb63
commit b05fcd02b9

View file

@ -401,7 +401,7 @@ func ExtractAddressToBytes(penalties []Address) []byte {
}
func ExtractAddressFromBytes(bytePenalties []byte) []Address {
if bytePenalties != nil && len(bytePenalties) < AddressLength {
if len(bytePenalties) < AddressLength {
return []Address{}
}
penalties := make([]Address, len(bytePenalties)/AddressLength)