diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-11-14 15:32:27 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2018-12-19 20:54:27 +0800 |
commit | 47d6ac16aef156de658f5ac87d9fa17500c4f401 (patch) | |
tree | 1c789c63fbe22348a5a1de1a858e8ae324305819 /dex/app.go | |
parent | 113d40d855d6f5dd295d46b5bf20e8db315ed01f (diff) | |
download | dexon-47d6ac16aef156de658f5ac87d9fa17500c4f401.tar dexon-47d6ac16aef156de658f5ac87d9fa17500c4f401.tar.gz dexon-47d6ac16aef156de658f5ac87d9fa17500c4f401.tar.bz2 dexon-47d6ac16aef156de658f5ac87d9fa17500c4f401.tar.lz dexon-47d6ac16aef156de658f5ac87d9fa17500c4f401.tar.xz dexon-47d6ac16aef156de658f5ac87d9fa17500c4f401.tar.zst dexon-47d6ac16aef156de658f5ac87d9fa17500c4f401.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 'dex/app.go')
-rw-r--r-- | dex/app.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/dex/app.go b/dex/app.go index a90dfae37..7d9c9e13a 100644 --- a/dex/app.go +++ b/dex/app.go @@ -362,6 +362,12 @@ func (d *DexconApp) VerifyBlock(block *coreTypes.Block) coreTypes.BlockVerifySta return coreTypes.VerifyInvalidBlock } + _, err := transactions.TouchSenders(types.MakeSigner(d.blockchain.Config(), new(big.Int))) + if err != nil { + log.Error("Failed to calculate sender", "error", err) + return coreTypes.VerifyInvalidBlock + } + addressNonce, err := d.validateNonce(transactions) if err != nil { log.Error("Validate nonce failed", "error", err) |