From 0507ec1691bf76a76056eda5cf1b26b7103d3eb0 Mon Sep 17 00:00:00 2001 From: Mikhail Kalinin Date: Sat, 11 Aug 2018 15:49:56 +0600 Subject: [PATCH] Merge result of inner CREATE only when all checks passed --- .../src/main/java/org/ethereum/vm/program/Program.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ethereumj-core/src/main/java/org/ethereum/vm/program/Program.java b/ethereumj-core/src/main/java/org/ethereum/vm/program/Program.java index e58e73622d..44e98658c0 100644 --- a/ethereumj-core/src/main/java/org/ethereum/vm/program/Program.java +++ b/ethereumj-core/src/main/java/org/ethereum/vm/program/Program.java @@ -475,8 +475,6 @@ this, new DataWord(newAddress), getOwnerAddress(), value, gasLimit, Program program = new Program(programCode, programInvoke, internalTx, config).withCommonConfig(commonConfig); vm.play(program); result = program.getResult(); - - getResult().merge(result); } // 4. CREATE THE CONTRACT OUT OF RETURN @@ -499,6 +497,8 @@ this, new DataWord(newAddress), getOwnerAddress(), value, gasLimit, track.saveCode(newAddress, code); } + getResult().merge(result); + if (result.getException() != null || result.isRevert()) { logger.debug("contract run halted by Exception: contract: [{}], exception: [{}]", toHexString(newAddress),