Skip to content

Commit

Permalink
Adding null check
Browse files Browse the repository at this point in the history
  • Loading branch information
nagarev committed Nov 20, 2023
1 parent 933f745 commit 20f89b5
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ public ProgramInvoke createProgramInvoke(Transaction tx, int txindex, Block bloc
/*** GASPRICE op ***/
Coin txGasPrice = tx.getGasPrice();

/*** BASEFEE op ***/
Coin minimumGasPrice = block.getMinimumGasPrice();

/*** GAS op ***/
byte[] gas = tx.getGasLimit();

Expand Down Expand Up @@ -98,6 +95,9 @@ public ProgramInvoke createProgramInvoke(Transaction tx, int txindex, Block bloc
/*** GASLIMIT op ***/
byte[] gaslimit = block.getGasLimit();

/*** BASEFEE op ***/
Coin minimumGasPrice = block.getMinimumGasPrice();

if (logger.isInfoEnabled()) {
logger.info("Top level call: \n" +
"address={}\n" +
Expand Down Expand Up @@ -135,8 +135,10 @@ public ProgramInvoke createProgramInvoke(Transaction tx, int txindex, Block bloc
minimumGasPrice);
}

byte[] minGasPrice = minimumGasPrice != null ? minimumGasPrice.getBytes() : ByteUtil.EMPTY_BYTE_ARRAY;

return new ProgramInvokeImpl(addr.getBytes(), origin, caller, balance.getBytes(), txGasPrice.getBytes(), gas, callValue.getBytes(), data,
lastHash, coinbase, timestamp, number, txindex,difficulty, gaslimit, minimumGasPrice.getBytes(),
lastHash, coinbase, timestamp, number, txindex,difficulty, gaslimit, minGasPrice,
repository, blockStore);
}

Expand Down

0 comments on commit 20f89b5

Please sign in to comment.