aboutsummaryrefslogtreecommitdiffstats
path: root/core/types
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-11-26 10:00:31 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-09 21:32:54 +0800
commit622ae7fe3ef067d4f395937a9bb0f783a7c1e6c7 (patch)
tree995b1db1cb20fc0fecb240338d089f0c49d1d986 /core/types
parentc11db35c2d3f5ca5f4b5749294e154f10ef6b1c1 (diff)
downloaddexon-622ae7fe3ef067d4f395937a9bb0f783a7c1e6c7.tar
dexon-622ae7fe3ef067d4f395937a9bb0f783a7c1e6c7.tar.gz
dexon-622ae7fe3ef067d4f395937a9bb0f783a7c1e6c7.tar.bz2
dexon-622ae7fe3ef067d4f395937a9bb0f783a7c1e6c7.tar.lz
dexon-622ae7fe3ef067d4f395937a9bb0f783a7c1e6c7.tar.xz
dexon-622ae7fe3ef067d4f395937a9bb0f783a7c1e6c7.tar.zst
dexon-622ae7fe3ef067d4f395937a9bb0f783a7c1e6c7.zip
core: various changes on tps tuning (#46)
Diffstat (limited to 'core/types')
-rw-r--r--core/types/transaction_signing.go15
1 files changed, 7 insertions, 8 deletions
diff --git a/core/types/transaction_signing.go b/core/types/transaction_signing.go
index 47c7a2f91..99e0c7896 100644
--- a/core/types/transaction_signing.go
+++ b/core/types/transaction_signing.go
@@ -173,9 +173,13 @@ func Sender(signer Signer, tx *Transaction) (common.Address, error) {
}
}
- addr, err := signer.Sender(tx)
- if err != nil {
- return common.Address{}, err
+ addr, ok := GlobalSigCache.Get(tx.Hash())
+ if !ok {
+ var err error
+ addr, err = signer.Sender(tx)
+ if err != nil {
+ return common.Address{}, err
+ }
}
tx.from.Store(sigCache{signer: signer, from: addr})
return addr, nil
@@ -218,11 +222,6 @@ func (s EIP155Signer) Equal(s2 Signer) bool {
var big8 = big.NewInt(8)
func (s EIP155Signer) Sender(tx *Transaction) (common.Address, error) {
- addr, ok := GlobalSigCache.Get(tx.Hash())
- if ok {
- return addr, nil
- }
-
if !tx.Protected() {
return HomesteadSigner{}.Sender(tx)
}