gas: Corruntly do float math

This commit is contained in:
Łukasz Magiera
2020-08-08 00:41:57 +02:00
parent aef3a4d21d
commit af15273f71
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ func (a *GasAPI) GasEstimateFeeCap(ctx context.Context, msg *types.Message, maxq
}
parentBaseFee := ts.Blocks()[0].ParentBaseFee
increaseFactor := math.Pow(1+float64(1/build.BaseFeeMaxChangeDenom), float64(maxqueueblks))
increaseFactor := math.Pow(1.+1./float64(build.BaseFeeMaxChangeDenom), float64(maxqueueblks))
feeInFuture := types.BigMul(parentBaseFee, types.NewInt(uint64(increaseFactor*(1<<8))))
feeInFuture = types.BigDiv(feeInFuture, types.NewInt(1<<8))