From 47d6ac16aef156de658f5ac87d9fa17500c4f401 Mon Sep 17 00:00:00 2001 From: Jimmy Hu Date: Wed, 14 Nov 2018 15:32:27 +0800 Subject: core, dex: Optimize sender calculation in block transactions. (#22) * Add Transactions.TouchSenders that calculates sender and update cache * Use TouchSenders to fill the caches --- dex/app.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'dex/app.go') 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) -- cgit v1.2.3