@@ -6,31 +6,25 @@ import (
6
6
"time"
7
7
"io"
8
8
"io/ioutil"
9
- //"log"
10
9
"os/exec"
11
10
"os"
12
11
"path/filepath"
13
12
"bufio"
14
13
"bytes"
15
- //"strings"
16
- //"sync"
17
- //"net"
14
+
18
15
19
16
config "github.com/ipfs/go-ipfs-config"
20
17
files "github.com/ipfs/go-ipfs-files"
21
18
libp2p "github.com/ipfs/go-ipfs/core/node/libp2p"
22
19
icore "github.com/ipfs/interface-go-ipfs-core"
23
20
icorepath "github.com/ipfs/interface-go-ipfs-core/path"
24
- //peerstore "github.com/libp2p/go-libp2p-peerstore"
25
- //ma "github.com/multiformats/go-multiaddr"
26
21
27
22
"github.com/ipfs/go-ipfs/core"
28
23
"github.com/ipfs/go-ipfs/core/coreapi"
29
24
"github.com/ipfs/go-ipfs/plugin/loader"
30
25
"github.com/ipfs/go-ipfs/repo/fsrepo"
31
26
"github.com/TwinProduction/go-color"
32
27
"github.com/cheggaaa/pb/v3"
33
- //"github.com/libp2p/go-libp2p-core/peer"
34
28
)
35
29
36
30
type path struct {
@@ -117,7 +111,8 @@ func spawnEphemeral(ctx context.Context) (icore.CoreAPI, error) {
117
111
return createNode (ctx , repoPath )
118
112
}
119
113
120
- func printDownloadedSize (totalSize int ) (err error ){
114
+ func printDownloadedSize (totalSize int ){
115
+
121
116
bar := pb .New (totalSize )
122
117
bar .Set (pb .Bytes , true )
123
118
bar .Set (pb .SIBytesPrefix , true )
@@ -129,7 +124,7 @@ func printDownloadedSize(totalSize int) (err error){
129
124
for {
130
125
fi , err := os .Stat ("blockchain.raw" )
131
126
if err != nil {
132
- return err
127
+ continue
133
128
}
134
129
size := fi .Size ()
135
130
@@ -150,7 +145,6 @@ func printDownloadedSize(totalSize int) (err error){
150
145
break
151
146
}
152
147
}
153
- return nil
154
148
}
155
149
156
150
func DownloadChain (hash string , importToolPath string , dataDir string , downloadOnly bool , importVerify bool , force bool ) {
0 commit comments