From 115d416e78674726ff51449d15f19a3c14a2e3ac Mon Sep 17 00:00:00 2001 From: romanman Date: Tue, 10 Jun 2014 21:47:10 +0100 Subject: [PATCH] VM gas cost: + fixed the memory usage, not to be charged by one more general step --- ethereumj-core/src/main/java/org/ethereum/vm/VM.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ethereumj-core/src/main/java/org/ethereum/vm/VM.java b/ethereumj-core/src/main/java/org/ethereum/vm/VM.java index 884be8d2..cf9107fc 100644 --- a/ethereumj-core/src/main/java/org/ethereum/vm/VM.java +++ b/ethereumj-core/src/main/java/org/ethereum/vm/VM.java @@ -81,12 +81,6 @@ public class VM { case CALL: program.spendGas(GasCost.CALL); break; - case MSTORE8: - case MSTORE: - // TODO: [cpp impl] do this when [go impl] spend just the usage size - // TODO: https://github.com/ethereum/cpp-ethereum/blob/develop/libevm/VM.h#L183 - program.spendGas(GasCost.STEP); - break; default: program.spendGas(GasCost.STEP); break; @@ -572,6 +566,9 @@ public class VM { this.step(program); } catch (RuntimeException e) { program.setRuntimeFailure(e); + } finally{ + + // todo: Here wrap the storage into result; } } }