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 GitHub
parent 09b66ea8c4
commit 4aafff2826
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -409,7 +409,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)