mirror of
https://github.com/status-im/ethereumj-personal.git
synced 2025-02-10 18:56:29 +00:00
Fix for requesting initResults after contract creation
This commit is contained in:
parent
402c64d4c0
commit
85371f289d
@ -188,8 +188,9 @@ public class WorldManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
byte[] code;
|
byte[] code;
|
||||||
|
boolean isContractCreation = tx.isContractCreation();
|
||||||
// 3. FIND OUT THE TRANSACTION TYPE
|
// 3. FIND OUT THE TRANSACTION TYPE
|
||||||
if (tx.isContractCreation()) {
|
if (isContractCreation) {
|
||||||
code = tx.getData(); // init code
|
code = tx.getData(); // init code
|
||||||
if (logger.isInfoEnabled())
|
if (logger.isInfoEnabled())
|
||||||
logger.info("running the init for contract: address={}",
|
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();
|
Block lastBlock = blockchain.getLastBlock();
|
||||||
|
|
||||||
ProgramInvoke programInvoke = ProgramInvokeFactory
|
ProgramInvoke programInvoke = ProgramInvokeFactory
|
||||||
@ -214,7 +215,7 @@ public class WorldManager {
|
|||||||
vm.play(program);
|
vm.play(program);
|
||||||
ProgramResult result = program.getResult();
|
ProgramResult result = program.getResult();
|
||||||
applyProgramResult(result, gasDebit, trackRepository,
|
applyProgramResult(result, gasDebit, trackRepository,
|
||||||
senderAddress, receiverAddress, coinbase, true);
|
senderAddress, receiverAddress, coinbase, isContractCreation);
|
||||||
}
|
}
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
trackRepository.rollback();
|
trackRepository.rollback();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user