aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-02-17 03:30:21 +0800
committerobscuren <geffobscura@gmail.com>2014-02-17 03:30:21 +0800
commit066940f134170ab4b0901887b69f824418c322fc (patch)
treefaace9c7c7896c30045a7f4036a5f62316d15eec /ethchain
parent07c12f0b921a05aec668ae8ce63b6dfac51d76a6 (diff)
downloadgo-tangerine-066940f134170ab4b0901887b69f824418c322fc.tar
go-tangerine-066940f134170ab4b0901887b69f824418c322fc.tar.gz
go-tangerine-066940f134170ab4b0901887b69f824418c322fc.tar.bz2
go-tangerine-066940f134170ab4b0901887b69f824418c322fc.tar.lz
go-tangerine-066940f134170ab4b0901887b69f824418c322fc.tar.xz
go-tangerine-066940f134170ab4b0901887b69f824418c322fc.tar.zst
go-tangerine-066940f134170ab4b0901887b69f824418c322fc.zip
Defer undo on the current block's state
Diffstat (limited to 'ethchain')
-rw-r--r--ethchain/block_manager.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/ethchain/block_manager.go b/ethchain/block_manager.go
index 8b237a29a..d9cdcd2d9 100644
--- a/ethchain/block_manager.go
+++ b/ethchain/block_manager.go
@@ -103,6 +103,11 @@ func (bm *BlockManager) ProcessBlock(block *Block) error {
// Processing a blocks may never happen simultaneously
bm.mutex.Lock()
defer bm.mutex.Unlock()
+ // Defer the Undo on the Trie. If the block processing happened
+ // we don't want to undo but since undo only happens on dirty
+ // nodes this won't happen because Commit would have been called
+ // before that.
+ defer bm.bc.CurrentBlock.State().Undo()
hash := block.Hash()