Skip to content

Commit

Permalink
core: allow a price overhead of 1 in case transaction cost is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
kyriediculous committed Apr 8, 2021
1 parent 0c15402 commit c7dd58e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,10 @@ func (orch *orchestrator) priceInfo(sender ethcommon.Address) (*big.Rat, error)
return nil, err
}

overhead = overhead.Add(overhead, new(big.Rat).Inv(txCostMultiplier))
if txCostMultiplier.Cmp(big.NewRat(0, 1)) > 0 {
overhead = overhead.Add(overhead, new(big.Rat).Inv(txCostMultiplier))
}

}
// pricePerPixel = basePrice * overhead
fixedPrice, err := common.PriceToFixed(new(big.Rat).Mul(basePrice, overhead))
Expand Down

0 comments on commit c7dd58e

Please sign in to comment.