aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-06-11 18:06:05 +0800
committerobscuren <geffobscura@gmail.com>2015-06-11 18:06:05 +0800
commit37111aa4bd215cfc8bcfb97cdc7e223649306196 (patch)
tree2bd689cb9939444819e605c3239ab5e60794c379
parentf599a1b5f143503817c9fa411854b9a8dac6ba72 (diff)
downloadgo-tangerine-37111aa4bd215cfc8bcfb97cdc7e223649306196.tar.gz
go-tangerine-37111aa4bd215cfc8bcfb97cdc7e223649306196.tar.zst
go-tangerine-37111aa4bd215cfc8bcfb97cdc7e223649306196.zip
core: retry block now also parellise nonce checks
-rw-r--r--core/block_processor.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/block_processor.go b/core/block_processor.go
index 190e72694..3ec3c585f 100644
--- a/core/block_processor.go
+++ b/core/block_processor.go
@@ -151,11 +151,17 @@ func (sm *BlockProcessor) RetryProcess(block *types.Block) (logs state.Logs, err
return nil, ParentError(header.ParentHash)
}
parent := sm.bc.GetBlock(header.ParentHash)
- if !sm.Pow.Verify(block) {
+
+ // FIXME Change to full header validation. See #1225
+ errch := make(chan bool)
+ go func() { errch <- sm.Pow.Verify(block) }()
+
+ logs, err = sm.processWithParent(block, parent)
+ if !<-errch {
return nil, ValidationError("Block's nonce is invalid (= %x)", block.Nonce)
}
- return sm.processWithParent(block, parent)
+ return logs, err
}
// Process block will attempt to process the given block's transactions and applies them