Skip to content

Commit

Permalink
fix bug that internal transfer fails
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobDenver007 committed May 28, 2019
1 parent baed222 commit 5797838
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion processor/transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ func (st *StateTransition) distributeToContract(name common.Name, intrinsicGas u
key := vm.DistributeKey{ObjectName: name,
ObjectType: params.ContractFeeType}
contractGas := int64(intrinsicGas * contractFounderRation / 100)
fmt.Println("intrinsicGas ", intrinsicGas, contractGas)
if _, ok := st.evm.FounderGasMap[key]; !ok {
st.evm.FounderGasMap[key] = vm.DistributeGas{
Value: contractGas,
Expand Down
5 changes: 3 additions & 2 deletions processor/vm/instructions.go
Original file line number Diff line number Diff line change
Expand Up @@ -903,17 +903,18 @@ func opCall(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *Sta

var ret []byte
var err error
var acct *accountmanager.Account
//var acct *accountmanager.Account
if p := PrecompiledContracts[userID]; p != nil {
ret, err = RunPrecompiledContract(p, args, contract)
} else {
acct, err := evm.AccountDB.GetAccountById(userID)
acct, err = evm.AccountDB.GetAccountById(userID)
if err != nil || acct == nil {
stack.push(evm.interpreter.intPool.getZero())
return nil, nil
}
toName := acct.GetName()
action := types.NewAction(types.CallContract, contract.Name(), toName, 0, evm.AssetID, gas, value, args, nil)

var returnGas uint64
ret, returnGas, err = evm.Call(contract, action, gas)
contract.Gas += returnGas
Expand Down

0 comments on commit 5797838

Please sign in to comment.