Unverified Commit 685eec31 authored by Péter Szilágyi's avatar Péter Szilágyi Committed by GitHub

Merge pull request #19012 from holiman/default155

ethapi: default to use eip-155 protected transactions
parents 9fa4c3ce 2ac61a99
...@@ -356,11 +356,7 @@ func (s *PrivateAccountAPI) signTransaction(ctx context.Context, args *SendTxArg ...@@ -356,11 +356,7 @@ func (s *PrivateAccountAPI) signTransaction(ctx context.Context, args *SendTxArg
// Assemble the transaction and sign with the wallet // Assemble the transaction and sign with the wallet
tx := args.toTransaction() tx := args.toTransaction()
var chainID *big.Int return wallet.SignTxWithPassphrase(account, passwd, tx, s.b.ChainConfig().ChainID)
if config := s.b.ChainConfig(); config.IsEIP155(s.b.CurrentBlock().Number()) {
chainID = config.ChainID
}
return wallet.SignTxWithPassphrase(account, passwd, tx, chainID)
} }
// SendTransaction will create a transaction from the given arguments and // SendTransaction will create a transaction from the given arguments and
...@@ -1186,11 +1182,7 @@ func (s *PublicTransactionPoolAPI) sign(addr common.Address, tx *types.Transacti ...@@ -1186,11 +1182,7 @@ func (s *PublicTransactionPoolAPI) sign(addr common.Address, tx *types.Transacti
return nil, err return nil, err
} }
// Request the wallet to sign the transaction // Request the wallet to sign the transaction
var chainID *big.Int return wallet.SignTx(account, tx, s.b.ChainConfig().ChainID)
if config := s.b.ChainConfig(); config.IsEIP155(s.b.CurrentBlock().Number()) {
chainID = config.ChainID
}
return wallet.SignTx(account, tx, chainID)
} }
// SendTxArgs represents the arguments to sumbit a new transaction into the transaction pool. // SendTxArgs represents the arguments to sumbit a new transaction into the transaction pool.
...@@ -1306,11 +1298,7 @@ func (s *PublicTransactionPoolAPI) SendTransaction(ctx context.Context, args Sen ...@@ -1306,11 +1298,7 @@ func (s *PublicTransactionPoolAPI) SendTransaction(ctx context.Context, args Sen
// Assemble the transaction and sign with the wallet // Assemble the transaction and sign with the wallet
tx := args.toTransaction() tx := args.toTransaction()
var chainID *big.Int signed, err := wallet.SignTx(account, tx, s.b.ChainConfig().ChainID)
if config := s.b.ChainConfig(); config.IsEIP155(s.b.CurrentBlock().Number()) {
chainID = config.ChainID
}
signed, err := wallet.SignTx(account, tx, chainID)
if err != nil { if err != nil {
return common.Hash{}, err return common.Hash{}, err
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment