mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
use crypto's api to replace magic numbers
This commit is contained in:
parent
41318f3776
commit
ac2b613eab
1 changed files with 1 additions and 2 deletions
|
|
@ -90,8 +90,7 @@ func Sender(signer Signer, tx *Transaction) (common.Address, error) {
|
|||
if err != nil {
|
||||
return common.Address{}, err
|
||||
}
|
||||
var addr common.Address
|
||||
copy(addr[:], crypto.Keccak256(pubkey[1:])[12:])
|
||||
addr := crypto.PubkeyToAddress(*crypto.ToECDSAPub(pubkey))
|
||||
tx.from.Store(sigCache{signer: signer, from: addr})
|
||||
return addr, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue