Fix for requesting initResults after contract creation

This commit is contained in:
nicksavers 2014-07-09 14:05:57 +02:00
parent 402c64d4c0
commit 85371f289d
1 changed files with 4 additions and 3 deletions

View File

@ -188,8 +188,9 @@ public class WorldManager {
}
byte[] code;
boolean isContractCreation = tx.isContractCreation();
// 3. FIND OUT THE TRANSACTION TYPE
if (tx.isContractCreation()) {
if (isContractCreation) {
code = tx.getData(); // init code
if (logger.isInfoEnabled())
logger.info("running the init for contract: address={}",
@ -203,7 +204,7 @@ public class WorldManager {
}
}
if (code != null) {
if (isContractCreation || code != null) {
Block lastBlock = blockchain.getLastBlock();
ProgramInvoke programInvoke = ProgramInvokeFactory
@ -214,7 +215,7 @@ public class WorldManager {
vm.play(program);
ProgramResult result = program.getResult();
applyProgramResult(result, gasDebit, trackRepository,
senderAddress, receiverAddress, coinbase, true);
senderAddress, receiverAddress, coinbase, isContractCreation);
}
} catch (RuntimeException e) {
trackRepository.rollback();