From 6540331acbb5909bee8a3bcefed514fff1e135d4 Mon Sep 17 00:00:00 2001 From: romanman Date: Fri, 27 Jun 2014 01:19:26 +0100 Subject: [PATCH] Fixing invoke bug --- .../src/main/java/org/ethereum/manager/WorldManager.java | 7 ------- .../main/java/org/ethereum/vm/ProgramInvokeFactory.java | 4 +--- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/ethereumj-core/src/main/java/org/ethereum/manager/WorldManager.java b/ethereumj-core/src/main/java/org/ethereum/manager/WorldManager.java index 72012846..8c0e2db1 100644 --- a/ethereumj-core/src/main/java/org/ethereum/manager/WorldManager.java +++ b/ethereumj-core/src/main/java/org/ethereum/manager/WorldManager.java @@ -76,7 +76,6 @@ public class WorldManager { public void applyTransaction(Transaction tx, byte[] coinbase) { - // TODO: refactor the wallet pending transactions to the world manager if (blockChain != null) blockChain.addWalletTransaction(tx); @@ -94,7 +93,6 @@ public class WorldManager { return; } - BigInteger nonce = repository.getNonce(senderAddress); if (nonce.compareTo(new BigInteger(tx.getNonce())) != 0) { if (stateLogger.isWarnEnabled()) @@ -108,7 +106,6 @@ public class WorldManager { // first of all debit the gas from the issuer BigInteger gasDebit = tx.getTotalGasValueDebit(); - gasDebit = gasDebit.multiply(new BigInteger(tx.getGasPrice())); // The coinbase get the gas cost repository.addBalance(coinbase, gasDebit); @@ -302,13 +299,9 @@ public class WorldManager { } - public void applyTransactionList(List txList) { - - } public void applyBlock(Block block) { - // miner reward if (repository.getAccountState(block.getCoinbase()) == null ) repository.createAccount(block.getCoinbase()); diff --git a/ethereumj-core/src/main/java/org/ethereum/vm/ProgramInvokeFactory.java b/ethereumj-core/src/main/java/org/ethereum/vm/ProgramInvokeFactory.java index 0614d596..0363f40e 100644 --- a/ethereumj-core/src/main/java/org/ethereum/vm/ProgramInvokeFactory.java +++ b/ethereumj-core/src/main/java/org/ethereum/vm/ProgramInvokeFactory.java @@ -48,7 +48,7 @@ public class ProgramInvokeFactory { byte[] gas = tx.getGasLimit(); /*** CALLVALUE op ***/ - byte[] callValue = tx.getValue(); + byte[] callValue = tx.getValue() == null ? new byte[]{0} : tx.getValue(); /*** CALLDATALOAD op ***/ @@ -76,8 +76,6 @@ public class ProgramInvokeFactory { long gaslimit = lastBlock.getGasLimit(); - repository.startTracking(); - if (logger.isInfoEnabled()){ logger.info("Program invocation: \n" + "address={}\n" +