mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core/types: reuse signtx
This commit is contained in:
parent
00905f7dc4
commit
b893ee3fd6
1 changed files with 1 additions and 6 deletions
|
|
@ -108,12 +108,7 @@ func SignTx(tx *Transaction, s Signer, prv *ecdsa.PrivateKey) (*Transaction, err
|
|||
// SignNewTx creates a transaction and signs it.
|
||||
func SignNewTx(prv *ecdsa.PrivateKey, s Signer, txdata TxData) (*Transaction, error) {
|
||||
tx := NewTx(txdata)
|
||||
h := s.Hash(tx)
|
||||
sig, err := crypto.Sign(h[:], prv)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return tx.WithSignature(s, sig)
|
||||
return SignTx(tx, s, prv)
|
||||
}
|
||||
|
||||
// MustSignNewTx creates a transaction and signs it.
|
||||
|
|
|
|||
Loading…
Reference in a new issue