From 066940f134170ab4b0901887b69f824418c322fc Mon Sep 17 00:00:00 2001
From: obscuren <geffobscura@gmail.com>
Date: Sun, 16 Feb 2014 20:30:21 +0100
Subject: Defer undo on the current block's state

---
 ethchain/block_manager.go | 5 +++++
 1 file changed, 5 insertions(+)

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()
 
-- 
cgit v1.2.3