diff options
author | obscuren <geffobscura@gmail.com> | 2014-02-17 03:30:21 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-02-17 03:30:21 +0800 |
commit | 066940f134170ab4b0901887b69f824418c322fc (patch) | |
tree | faace9c7c7896c30045a7f4036a5f62316d15eec /ethchain/block_manager.go | |
parent | 07c12f0b921a05aec668ae8ce63b6dfac51d76a6 (diff) | |
download | go-tangerine-066940f134170ab4b0901887b69f824418c322fc.tar.gz go-tangerine-066940f134170ab4b0901887b69f824418c322fc.tar.zst go-tangerine-066940f134170ab4b0901887b69f824418c322fc.zip |
Defer undo on the current block's state
Diffstat (limited to 'ethchain/block_manager.go')
-rw-r--r-- | ethchain/block_manager.go | 5 |
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() |