Skip to content

Commit

Permalink
autopilot: switch isBelowCollateralThreshold if-condition for 0 expec…
Browse files Browse the repository at this point in the history
…ted collateral
  • Loading branch information
ChrisSchinnerl committed Sep 14, 2023
1 parent 93e0422 commit 39b09a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autopilot/hostfilter.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func isOutOfCollateral(c api.Contract, s rhpv2.HostSettings, pt rhpv3.HostPriceT
// our expectation using the host settings.
func isBelowCollateralThreshold(expectedCollateral, actualCollateral types.Currency) bool {
if expectedCollateral.IsZero() {
return true // protect against division-by-zero
return false // protect against division-by-zero
}
collateral := big.NewRat(0, 1).SetFrac(actualCollateral.Big(), expectedCollateral.Big())
threshold := big.NewRat(minContractCollateralThresholdNumerator, minContractCollateralThresholdDenominator)
Expand Down

0 comments on commit 39b09a9

Please sign in to comment.