diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-11-14 15:32:27 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-03-12 12:19:09 +0800 |
commit | 4f43b560b50eb190d9ee2b677fb9482bda6e10e6 (patch) | |
tree | 88fe62025306a162024473d5975d6bf5dddb7dc4 /dex | |
parent | 218796246ce17503ff5903ddb803a1c47d733778 (diff) | |
download | dexon-4f43b560b50eb190d9ee2b677fb9482bda6e10e6.tar.gz dexon-4f43b560b50eb190d9ee2b677fb9482bda6e10e6.tar.zst dexon-4f43b560b50eb190d9ee2b677fb9482bda6e10e6.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')
-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) |