Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Gas estimation: make sure we always return a lowestIndex for a range (
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmurdoch committed Apr 30, 2019
1 parent 8ad1ab2 commit 5f9537c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils/gasEstimation.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ module.exports = (vm, runArgs, err, callback) => {
*/
const findLowestIndex = (start, stop) => {
let lowestGas = Infinity;
let lowestIndex;
let lowestIndex = stop;
for (let i = start; i <= stop; i++) {
if (steps.ops[i].gasLeft <= lowestGas) {
// Find the new lowest gas index
Expand Down

0 comments on commit 5f9537c

Please sign in to comment.