Skip to content

Commit

Permalink
fix(MaxInitcodeSize): fix NPE in transactionCost() method
Browse files Browse the repository at this point in the history
  • Loading branch information
Vovchyk committed Sep 20, 2024
1 parent 6fe81bb commit 85879d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rskj-core/src/main/java/org/ethereum/core/Transaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public long transactionCost(Constants constants, ActivationConfig.ForBlock activ
long zeroVals = getLength(this.getData()) - nonZeroes;

long transactionCost = this.isContractCreation()
? GasCost.add(GasCost.TRANSACTION_CREATE_CONTRACT, InitcodeCostCalculator.getInstance().calculateCost(this.getData().length, activations))
? GasCost.add(GasCost.TRANSACTION_CREATE_CONTRACT, InitcodeCostCalculator.getInstance().calculateCost(getLength(this.getData()), activations))
: GasCost.TRANSACTION;

long txNonZeroDataCost = getTxNonZeroDataCost(activations);
Expand Down

0 comments on commit 85879d1

Please sign in to comment.