From c0ae95fd83c977a0efd51986e85c2b0143cdd085 Mon Sep 17 00:00:00 2001
From: Benjamin Bollen <ben@erisindustries.com>
Date: Thu, 28 Jul 2016 18:38:58 +0000
Subject: [PATCH] tendermint vm: fix issues #164

---
 .../src/github.com/tendermint/tendermint/vm/vm.go     | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/Godeps/_workspace/src/github.com/tendermint/tendermint/vm/vm.go b/Godeps/_workspace/src/github.com/tendermint/tendermint/vm/vm.go
index 1af17350..f3d02f21 100644
--- a/Godeps/_workspace/src/github.com/tendermint/tendermint/vm/vm.go
+++ b/Godeps/_workspace/src/github.com/tendermint/tendermint/vm/vm.go
@@ -800,19 +800,16 @@ func (vm *VM) call(caller, callee *Account, code, input []byte, value int64, gas
 					}
 					ret, err = vm.Call(callee, callee, acc.Code, args, value, gas)
 				} else {
+					// nil account means we're sending funds to a new account
 					if acc == nil {
-						// nil account means we're sending funds to a new account
 						if !HasPermission(vm.appState, caller, ptypes.CreateAccount) {
 							return nil, ErrPermission{"create_account"}
 						}
 						acc = &Account{Address: addr}
-						vm.appState.UpdateAccount(acc)
-						// send funds to new account
-						ret, err = vm.Call(callee, acc, acc.Code, args, value, gas)
-					} else {
-						// call standard contract
-						ret, err = vm.Call(callee, acc, acc.Code, args, value, gas)
 					}
+					// add account to the tx cache
+					vm.appState.UpdateAccount(acc)
+					ret, err = vm.Call(callee, acc, acc.Code, args, value, gas)
 				}
 			}
 
-- 
GitLab