mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-11 22:43:47 +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 {
|
if err != nil {
|
||||||
return common.Address{}, err
|
return common.Address{}, err
|
||||||
}
|
}
|
||||||
var addr common.Address
|
addr := crypto.PubkeyToAddress(*crypto.ToECDSAPub(pubkey))
|
||||||
copy(addr[:], crypto.Keccak256(pubkey[1:])[12:])
|
|
||||||
tx.from.Store(sigCache{signer: signer, from: addr})
|
tx.from.Store(sigCache{signer: signer, from: addr})
|
||||||
return addr, nil
|
return addr, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue