mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 17:33:47 +00:00
Update chain.go
This commit is contained in:
parent
f519111a5d
commit
a487d74971
1 changed files with 2 additions and 7 deletions
|
|
@ -165,13 +165,8 @@ func (c *Chain) RootAt(height int) common.Hash {
|
|||
// GetSender returns the address associated with account at the index in the
|
||||
// pre-funded accounts list.
|
||||
func (c *Chain) GetSender(idx int) (common.Address, uint64) {
|
||||
accounts := make([]common.Address, 0, len(c.senders))
|
||||
for addr := range c.senders {
|
||||
accounts = append(accounts, addr)
|
||||
}
|
||||
slices.SortFunc(accounts, func(a, b common.Address) int {
|
||||
return bytes.Compare(a[:], b[:])
|
||||
})
|
||||
accounts := slices.Clone(c.senders)
|
||||
slices.SortFunc(accounts, commmon.Address.Cmp)
|
||||
addr := accounts[idx]
|
||||
return addr, c.senders[addr].Nonce
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue