@cryptotaxi247 / kubo / commits / 6155fd17c

fix bug 6748 ipfs add whit only hash, don't need to announce cid to other peer

fix bug 6748 ipfs add whit only hash, don't need to announce cid to other peer

hucg committed Nov 8, 2019 at 15:12 UTC 6155fd17c105955380d8f80b8f944449e62c275d
1 file changed +4 -2
core/coreapi/unixfs.go
+4 -2
@@ -127,8 +127,10 @@ func (api *UnixfsAPI) Add(ctx context.Context, files files.Node, opts ...options
127 return nil, err
128 }
129
130 - if err := api.provider.Provide(nd.Cid()); err != nil {
131 - return nil, err
130 + if !settings.OnlyHash {
131 + if err := api.provider.Provide(nd.Cid()); err != nil {
132 + return nil, err
133 + }
134 }
135
136 return path.IpfsPath(nd.Cid()), nil