miner: fix required collateral check

This commit is contained in:
Łukasz Magiera 2019-09-23 13:26:45 +02:00
parent 18651ecaa3
commit b79b826805
2 changed files with 2 additions and 2 deletions

View File

@ -247,7 +247,7 @@ func (sma StorageMinerActor) CommitSector(act *types.Actor, vmctx types.VMContex
futurePower := types.BigAdd(self.Power, mi.SectorSize) futurePower := types.BigAdd(self.Power, mi.SectorSize)
collateralRequired := CollateralForPower(futurePower) 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") return nil, aerrors.New(3, "not enough collateral")
} }

2
go.mod
View File

@ -1,6 +1,6 @@
module github.com/filecoin-project/go-lotus module github.com/filecoin-project/go-lotus
go 1.12 go 1.13
require ( require (
contrib.go.opencensus.io/exporter/jaeger v0.1.0 contrib.go.opencensus.io/exporter/jaeger v0.1.0