From b79b826805bebdbc35557ccd2d325869eebf6844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Mon, 23 Sep 2019 13:26:45 +0200 Subject: [PATCH] miner: fix required collateral check --- chain/actors/actor_miner.go | 2 +- go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chain/actors/actor_miner.go b/chain/actors/actor_miner.go index 9b01e95e0..f0e796d47 100644 --- a/chain/actors/actor_miner.go +++ b/chain/actors/actor_miner.go @@ -247,7 +247,7 @@ func (sma StorageMinerActor) CommitSector(act *types.Actor, vmctx types.VMContex futurePower := types.BigAdd(self.Power, mi.SectorSize) collateralRequired := CollateralForPower(futurePower) - if types.BigCmp(collateralRequired, act.Balance) < 0 { + if types.BigCmp(act.Balance, collateralRequired) < 0 { return nil, aerrors.New(3, "not enough collateral") } diff --git a/go.mod b/go.mod index 50cdb4068..4c3f8afd6 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/filecoin-project/go-lotus -go 1.12 +go 1.13 require ( contrib.go.opencensus.io/exporter/jaeger v0.1.0