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

Gas estimation: make sure we always return a lowestIndex for a range #421

Merged
merged 1 commit into from
Apr 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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