|
|
@ -497,8 +497,8 @@ module.exports = class MetamaskController extends EventEmitter { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const lowestPrices = recentBlocks.map((block) => { |
|
|
|
const lowestPrices = recentBlocks.map((block) => { |
|
|
|
if (!block.gasPrices) { |
|
|
|
if (!block.gasPrices || block.gasPrices.length < 1) { |
|
|
|
return new BN(0) |
|
|
|
return GWEI_BN |
|
|
|
} |
|
|
|
} |
|
|
|
return block.gasPrices |
|
|
|
return block.gasPrices |
|
|
|
.map(hexPrefix => hexPrefix.substr(2)) |
|
|
|
.map(hexPrefix => hexPrefix.substr(2)) |
|
|
@ -508,6 +508,7 @@ module.exports = class MetamaskController extends EventEmitter { |
|
|
|
})[0] |
|
|
|
})[0] |
|
|
|
}) |
|
|
|
}) |
|
|
|
.map(number => number.div(GWEI_BN).toNumber()) |
|
|
|
.map(number => number.div(GWEI_BN).toNumber()) |
|
|
|
|
|
|
|
|
|
|
|
const percentileNum = percentile(50, lowestPrices) |
|
|
|
const percentileNum = percentile(50, lowestPrices) |
|
|
|
const percentileNumBn = new BN(percentileNum) |
|
|
|
const percentileNumBn = new BN(percentileNum) |
|
|
|
return '0x' + percentileNumBn.mul(GWEI_BN).toString(16) |
|
|
|
return '0x' + percentileNumBn.mul(GWEI_BN).toString(16) |
|
|
|