From 39b09a9a5cba7df5e488f68e13fa2eebca8cf60e Mon Sep 17 00:00:00 2001 From: Chris Schinnerl Date: Thu, 14 Sep 2023 10:52:12 +0200 Subject: [PATCH] autopilot: switch isBelowCollateralThreshold if-condition for 0 expected collateral --- autopilot/hostfilter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autopilot/hostfilter.go b/autopilot/hostfilter.go index e909a03c7..b10bc9969 100644 --- a/autopilot/hostfilter.go +++ b/autopilot/hostfilter.go @@ -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)