Skip to content
Snippets Groups Projects
Commit e12bbb8c authored by Casey Kuhlman's avatar Casey Kuhlman Committed by GitHub
Browse files

Merge pull request #184 from benjaminbollen/issue-164

tendermint vm: fix issues #164
parents 4fc4fab5 c0ae95fd
No related branches found
No related tags found
No related merge requests found
......@@ -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)
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment