aboutsummaryrefslogtreecommitdiffstats
path: root/internal
diff options
context:
space:
mode:
authorMartin Holst Swende <martin@swende.se>2019-02-07 18:59:17 +0800
committerMartin Holst Swende <martin@swende.se>2019-02-07 18:59:17 +0800
commit2ac61a99146f2570f753b499b8b1712c2c29974a (patch)
treee5df510b89edbcc3b2c732a9e6c1f5ba76bf0cf5 /internal
parentc57166caa371d5b67db39f6f6851856023f8423c (diff)
downloadgo-tangerine-2ac61a99146f2570f753b499b8b1712c2c29974a.tar
go-tangerine-2ac61a99146f2570f753b499b8b1712c2c29974a.tar.gz
go-tangerine-2ac61a99146f2570f753b499b8b1712c2c29974a.tar.bz2
go-tangerine-2ac61a99146f2570f753b499b8b1712c2c29974a.tar.lz
go-tangerine-2ac61a99146f2570f753b499b8b1712c2c29974a.tar.xz
go-tangerine-2ac61a99146f2570f753b499b8b1712c2c29974a.tar.zst
go-tangerine-2ac61a99146f2570f753b499b8b1712c2c29974a.zip
ethapi: default to use eip-155 protected transactions
Diffstat (limited to 'internal')
-rw-r--r--internal/ethapi/api.go18
1 files changed, 3 insertions, 15 deletions
diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go
index 0aeec8ad1..b3fd4522a 100644
--- a/internal/ethapi/api.go
+++ b/internal/ethapi/api.go
@@ -356,11 +356,7 @@ func (s *PrivateAccountAPI) signTransaction(ctx context.Context, args *SendTxArg
// Assemble the transaction and sign with the wallet
tx := args.toTransaction()
- var chainID *big.Int
- if config := s.b.ChainConfig(); config.IsEIP155(s.b.CurrentBlock().Number()) {
- chainID = config.ChainID
- }
- return wallet.SignTxWithPassphrase(account, passwd, tx, chainID)
+ return wallet.SignTxWithPassphrase(account, passwd, tx, s.b.ChainConfig().ChainID)
}
// SendTransaction will create a transaction from the given arguments and
@@ -1186,11 +1182,7 @@ func (s *PublicTransactionPoolAPI) sign(addr common.Address, tx *types.Transacti
return nil, err
}
// Request the wallet to sign the transaction
- var chainID *big.Int
- if config := s.b.ChainConfig(); config.IsEIP155(s.b.CurrentBlock().Number()) {
- chainID = config.ChainID
- }
- return wallet.SignTx(account, tx, chainID)
+ return wallet.SignTx(account, tx, s.b.ChainConfig().ChainID)
}
// 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
// Assemble the transaction and sign with the wallet
tx := args.toTransaction()
- var chainID *big.Int
- if config := s.b.ChainConfig(); config.IsEIP155(s.b.CurrentBlock().Number()) {
- chainID = config.ChainID
- }
- signed, err := wallet.SignTx(account, tx, chainID)
+ signed, err := wallet.SignTx(account, tx, s.b.ChainConfig().ChainID)
if err != nil {
return common.Hash{}, err
}