diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-11-14 15:32:27 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:18 +0800 |
commit | d151e9b72c3af7570c14ba3e9bc773e33a6c1e73 (patch) | |
tree | 84dae196d64000ca14a57472710848f3dbdd40b5 /dex | |
parent | 9bf7d31fc35c88b063c0de00997504d78f40df13 (diff) | |
download | go-tangerine-d151e9b72c3af7570c14ba3e9bc773e33a6c1e73.tar.gz go-tangerine-d151e9b72c3af7570c14ba3e9bc773e33a6c1e73.tar.zst go-tangerine-d151e9b72c3af7570c14ba3e9bc773e33a6c1e73.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) |