Fixing invoke bug
This commit is contained in:
parent
7cf755f448
commit
6540331acb
|
@ -76,7 +76,6 @@ public class WorldManager {
|
||||||
|
|
||||||
public void applyTransaction(Transaction tx, byte[] coinbase) {
|
public void applyTransaction(Transaction tx, byte[] coinbase) {
|
||||||
|
|
||||||
|
|
||||||
// TODO: refactor the wallet pending transactions to the world manager
|
// TODO: refactor the wallet pending transactions to the world manager
|
||||||
if (blockChain != null)
|
if (blockChain != null)
|
||||||
blockChain.addWalletTransaction(tx);
|
blockChain.addWalletTransaction(tx);
|
||||||
|
@ -94,7 +93,6 @@ public class WorldManager {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BigInteger nonce = repository.getNonce(senderAddress);
|
BigInteger nonce = repository.getNonce(senderAddress);
|
||||||
if (nonce.compareTo(new BigInteger(tx.getNonce())) != 0) {
|
if (nonce.compareTo(new BigInteger(tx.getNonce())) != 0) {
|
||||||
if (stateLogger.isWarnEnabled())
|
if (stateLogger.isWarnEnabled())
|
||||||
|
@ -108,7 +106,6 @@ public class WorldManager {
|
||||||
|
|
||||||
// first of all debit the gas from the issuer
|
// first of all debit the gas from the issuer
|
||||||
BigInteger gasDebit = tx.getTotalGasValueDebit();
|
BigInteger gasDebit = tx.getTotalGasValueDebit();
|
||||||
gasDebit = gasDebit.multiply(new BigInteger(tx.getGasPrice()));
|
|
||||||
|
|
||||||
// The coinbase get the gas cost
|
// The coinbase get the gas cost
|
||||||
repository.addBalance(coinbase, gasDebit);
|
repository.addBalance(coinbase, gasDebit);
|
||||||
|
@ -302,13 +299,9 @@ public class WorldManager {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void applyTransactionList(List<Transaction> txList) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void applyBlock(Block block) {
|
public void applyBlock(Block block) {
|
||||||
|
|
||||||
|
|
||||||
// miner reward
|
// miner reward
|
||||||
if (repository.getAccountState(block.getCoinbase()) == null )
|
if (repository.getAccountState(block.getCoinbase()) == null )
|
||||||
repository.createAccount(block.getCoinbase());
|
repository.createAccount(block.getCoinbase());
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class ProgramInvokeFactory {
|
||||||
byte[] gas = tx.getGasLimit();
|
byte[] gas = tx.getGasLimit();
|
||||||
|
|
||||||
/*** CALLVALUE op ***/
|
/*** CALLVALUE op ***/
|
||||||
byte[] callValue = tx.getValue();
|
byte[] callValue = tx.getValue() == null ? new byte[]{0} : tx.getValue();
|
||||||
|
|
||||||
|
|
||||||
/*** CALLDATALOAD op ***/
|
/*** CALLDATALOAD op ***/
|
||||||
|
@ -76,8 +76,6 @@ public class ProgramInvokeFactory {
|
||||||
long gaslimit = lastBlock.getGasLimit();
|
long gaslimit = lastBlock.getGasLimit();
|
||||||
|
|
||||||
|
|
||||||
repository.startTracking();
|
|
||||||
|
|
||||||
if (logger.isInfoEnabled()){
|
if (logger.isInfoEnabled()){
|
||||||
logger.info("Program invocation: \n" +
|
logger.info("Program invocation: \n" +
|
||||||
"address={}\n" +
|
"address={}\n" +
|
||||||
|
|
Loading…
Reference in New Issue