Play program dialog

+ Fix for OOG Exception
This commit is contained in:
romanman 2014-06-18 10:39:26 +01:00
parent 18fee1eff8
commit 708428c01e
2 changed files with 11 additions and 8 deletions

View File

@ -50,14 +50,6 @@ public class Program {
this.invokeData = invokeData;
this.ops = ops;
// In case the program invoked by wire got
// transaction, this will be the gas cost,
// otherwise the call done by other contract
// charged by CALL op
if (invokeData.byTransaction()){
spendGas(GasCost.TRANSACTION, "TRANSACTION");
spendGas(GasCost.TXDATA * invokeData.getDataSize().intValue(), "DATA");
}
if (invokeData.getStorage() != null){
storage = invokeData.getStorage();

View File

@ -569,6 +569,17 @@ public class VM {
public void play(Program program) {
try {
// In case the program invoked by wire got
// transaction, this will be the gas cost,
// otherwise the call done by other contract
// charged by CALL op
if (program.invokeData.byTransaction()){
program.spendGas(GasCost.TRANSACTION, "TRANSACTION");
program.spendGas(GasCost.TXDATA * program.invokeData.getDataSize().intValue(), "DATA");
}
while(!program.isStopped())
this.step(program);
} catch (RuntimeException e) {