diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-11-14 15:32:27 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:53 +0800 |
commit | 2cbbadc739c79b2fb488a6e7e0ac7593ac469737 (patch) | |
tree | 391e27c766a75e545e36315dea54d5bfbf508fbf /core/blockchain.go | |
parent | 129b9f9f5c5c8b8c6581d1ebd68c3e31157ea570 (diff) | |
download | dexon-2cbbadc739c79b2fb488a6e7e0ac7593ac469737.tar dexon-2cbbadc739c79b2fb488a6e7e0ac7593ac469737.tar.gz dexon-2cbbadc739c79b2fb488a6e7e0ac7593ac469737.tar.bz2 dexon-2cbbadc739c79b2fb488a6e7e0ac7593ac469737.tar.lz dexon-2cbbadc739c79b2fb488a6e7e0ac7593ac469737.tar.xz dexon-2cbbadc739c79b2fb488a6e7e0ac7593ac469737.tar.zst dexon-2cbbadc739c79b2fb488a6e7e0ac7593ac469737.zip |
core, dex: Optimize sender calculation in block transactions. (#22)
* Add Transactions.TouchSenders that calculates sender and update cache
* Use TouchSenders to fill the caches
Diffstat (limited to 'core/blockchain.go')
-rw-r--r-- | core/blockchain.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/blockchain.go b/core/blockchain.go index 3b71cb64b..60730d197 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -347,6 +347,10 @@ func (bc *BlockChain) AddConfirmedBlock(block *coreTypes.Block) error { if err != nil { return err } + _, err := transactions.TouchSenders(types.MakeSigner(bc.Config(), new(big.Int))) + if err != nil { + return err + } addressMap := map[common.Address]struct{}{} for _, tx := range transactions { |