Merge pull request #4179 from filecoin-project/fix/export-unclean-exit

chain export: Error with unfinished exports
This commit is contained in:
Jakub Sztandera
2020-10-06 13:30:53 +02:00
committed by GitHub
2 changed files with 25 additions and 12 deletions
+7
View File
@@ -1070,13 +1070,20 @@ var chainExportCmd = &cli.Command{
return err
}
var last bool
for b := range stream {
last = len(b) == 0
_, err := fi.Write(b)
if err != nil {
return err
}
}
if !last {
return xerrors.Errorf("incomplete export (remote connection lost?)")
}
return nil
},
}