diff options
author | obscuren <geffobscura@gmail.com> | 2015-04-20 22:02:50 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-04-20 22:02:50 +0800 |
commit | 72d065d49102dd07c929d1e147186604c5e4ab05 (patch) | |
tree | db62f3c8eabf88269707eaba69b0755b920df50a /core/block_processor.go | |
parent | 97a9753f87cce4f0072feba63f2e137138a16063 (diff) | |
download | go-tangerine-72d065d49102dd07c929d1e147186604c5e4ab05.tar go-tangerine-72d065d49102dd07c929d1e147186604c5e4ab05.tar.gz go-tangerine-72d065d49102dd07c929d1e147186604c5e4ab05.tar.bz2 go-tangerine-72d065d49102dd07c929d1e147186604c5e4ab05.tar.lz go-tangerine-72d065d49102dd07c929d1e147186604c5e4ab05.tar.xz go-tangerine-72d065d49102dd07c929d1e147186604c5e4ab05.tar.zst go-tangerine-72d065d49102dd07c929d1e147186604c5e4ab05.zip |
core: force block process & fixed chain manager test
Diffstat (limited to 'core/block_processor.go')
-rw-r--r-- | core/block_processor.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/block_processor.go b/core/block_processor.go index b624037a5..3030af27d 100644 --- a/core/block_processor.go +++ b/core/block_processor.go @@ -149,6 +149,20 @@ func (self *BlockProcessor) ApplyTransactions(coinbase *state.StateObject, state return receipts, err } +func (sm *BlockProcessor) RetryProcess(block *types.Block) (logs state.Logs, err error) { + // Processing a blocks may never happen simultaneously + sm.mutex.Lock() + defer sm.mutex.Unlock() + + header := block.Header() + if !sm.bc.HasBlock(header.ParentHash) { + return nil, ParentError(header.ParentHash) + } + parent := sm.bc.GetBlock(header.ParentHash) + + return sm.processWithParent(block, parent) +} + // Process block will attempt to process the given block's transactions and applies them // on top of the block's parent state (given it exists) and will return wether it was // successful or not. |