mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 10:50:44 +00:00
common: improve variable names for ExtractAddressFromBytes(), close XFN-27 (#1726)
This commit is contained in:
parent
4716dc11af
commit
07e2609c25
1 changed files with 6 additions and 6 deletions
|
|
@ -408,15 +408,15 @@ func ExtractAddressToBytes(penalties []Address) []byte {
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
func ExtractAddressFromBytes(bytePenalties []byte) []Address {
|
func ExtractAddressFromBytes(rawBytes []byte) []Address {
|
||||||
if len(bytePenalties) < AddressLength {
|
if len(rawBytes) < AddressLength {
|
||||||
return []Address{}
|
return []Address{}
|
||||||
}
|
}
|
||||||
penalties := make([]Address, len(bytePenalties)/AddressLength)
|
addresses := make([]Address, len(rawBytes)/AddressLength)
|
||||||
for i := 0; i < len(penalties); i++ {
|
for i := 0; i < len(addresses); i++ {
|
||||||
copy(penalties[i][:], bytePenalties[i*AddressLength:])
|
copy(addresses[i][:], rawBytes[i*AddressLength:])
|
||||||
}
|
}
|
||||||
return penalties
|
return addresses
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddressEIP55 is an alias of Address with a customized json marshaller
|
// AddressEIP55 is an alias of Address with a customized json marshaller
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue