Skip to content

Commit

Permalink
RemoveFromSectorSet2 is declared but never used, remove redclared one
Browse files Browse the repository at this point in the history
  • Loading branch information
dtynn committed Jan 18, 2020
1 parent ae8a9a9 commit 8bd6216
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions chain/actors/actor_miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/filecoin-project/lotus/chain/types"

"github.com/filecoin-project/go-amt-ipld"
amt2 "github.com/filecoin-project/go-amt-ipld/v2"
"github.com/ipfs/go-cid"
cbor "github.com/ipfs/go-ipld-cbor"
"github.com/libp2p/go-libp2p-core/peer"
Expand Down Expand Up @@ -639,27 +638,6 @@ func RemoveFromSectorSet(ctx context.Context, s types.Storage, ss cid.Cid, ids [
return ncid, nil
}

func RemoveFromSectorSet2(ctx context.Context, s types.Storage, ss cid.Cid, ids []uint64) (cid.Cid, aerrors.ActorError) {

ssr, err := amt2.LoadAMT(types.WrapStorage(s), ss)
if err != nil {
return cid.Undef, aerrors.HandleExternalError(err, "could not load sector set node")
}

for _, id := range ids {
if err := ssr.Delete(id); err != nil {
log.Warnf("failed to delete sector %d from set: %s", id, err)
}
}

ncid, err := ssr.Flush()
if err != nil {
return cid.Undef, aerrors.HandleExternalError(err, "failed to flush sector set")
}

return ncid, nil
}

func CollateralForPower(power types.BigInt) types.BigInt {
return types.BigMul(power, types.NewInt(10))
/* TODO: this
Expand Down

0 comments on commit 8bd6216

Please sign in to comment.