diff --git a/cli/chain.go b/cli/chain.go index 8fe34ad16..6f691edee 100644 --- a/cli/chain.go +++ b/cli/chain.go @@ -455,7 +455,7 @@ var chainBisectCmd = &cli.Command{ for { mid := (start + end) / 2 - if end - start == 1 { + if end-start == 1 { mid = end start = end } diff --git a/node/impl/storminer.go b/node/impl/storminer.go index 7a60119c5..4c54a4074 100644 --- a/node/impl/storminer.go +++ b/node/impl/storminer.go @@ -108,11 +108,21 @@ func (sm *StorageMinerAPI) remotePutSector(w http.ResponseWriter, r *http.Reques } // This is going to get better with worker-to-worker transfers - path, err := sm.SectorBuilder.AllocSectorPath(fs.DataType(vars["type"]), id, true) + + path, err := sm.SectorBuilder.SectorPath(fs.DataType(vars["type"]), id) if err != nil { - log.Error(err) - w.WriteHeader(500) - return + if err != fs.ErrNotFound { + log.Error(err) + w.WriteHeader(500) + return + } + + path, err = sm.SectorBuilder.AllocSectorPath(fs.DataType(vars["type"]), id, true) + if err != nil { + log.Error(err) + w.WriteHeader(500) + return + } } mediatype, _, err := mime.ParseMediaType(r.Header.Get("Content-Type"))