From c7e4217693e8d3a921a6dd9b2d3c6d4981ddec67 Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Tue, 21 Sep 2021 16:45:00 +0200 Subject: [PATCH] fix staging area path buildup --- node/modules/storageminer.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/node/modules/storageminer.go b/node/modules/storageminer.go index b59a1143b..0fd7749da 100644 --- a/node/modules/storageminer.go +++ b/node/modules/storageminer.go @@ -70,7 +70,10 @@ import ( "github.com/filecoin-project/lotus/storage" ) -var StorageCounterDSPrefix = "/storage/nextid" +var ( + StorageCounterDSPrefix = "/storage/nextid" + StagingAreaDirName = "deal-staging" +) func minerAddrFromDS(ds dtypes.MetadataDS) (address.Address, error) { maddrb, err := ds.Get(datastore.NewKey("miner-address")) @@ -536,7 +539,8 @@ func BasicDealFilter(cfg config.DealmakingConfig, user dtypes.StorageDealFilter) return false, "miner error", err } - diskUsageBytes, err := r.DiskUsage(r.Path() + "/deal-staging") + dir := filepath.Join(r.Path(), StagingAreaDirName) + diskUsageBytes, err := r.DiskUsage(dir) if err != nil { return false, "miner error", err } @@ -574,7 +578,7 @@ func StorageProvider(minerAddress dtypes.MinerAddress, ) (storagemarket.StorageProvider, error) { net := smnet.NewFromLibp2pHost(h) - dir := filepath.Join(r.Path(), "deal-staging") + dir := filepath.Join(r.Path(), StagingAreaDirName) // migrate temporary files that were created directly under the repo, by // moving them to the new directory and symlinking them.