mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +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
|
||||
}
|
||||
|
||||
func ExtractAddressFromBytes(bytePenalties []byte) []Address {
|
||||
if len(bytePenalties) < AddressLength {
|
||||
func ExtractAddressFromBytes(rawBytes []byte) []Address {
|
||||
if len(rawBytes) < AddressLength {
|
||||
return []Address{}
|
||||
}
|
||||
penalties := make([]Address, len(bytePenalties)/AddressLength)
|
||||
for i := 0; i < len(penalties); i++ {
|
||||
copy(penalties[i][:], bytePenalties[i*AddressLength:])
|
||||
addresses := make([]Address, len(rawBytes)/AddressLength)
|
||||
for i := 0; i < len(addresses); i++ {
|
||||
copy(addresses[i][:], rawBytes[i*AddressLength:])
|
||||
}
|
||||
return penalties
|
||||
return addresses
|
||||
}
|
||||
|
||||
// AddressEIP55 is an alias of Address with a customized json marshaller
|
||||
|
|
|
|||
Loading…
Reference in a new issue