fix
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
This commit is contained in:
parent
a10690359c
commit
009cd92010
@ -20,12 +20,14 @@ import (
|
|||||||
// The flag useForRetrieval indicates if the IPFS node will also be used for storing retrieving deals.
|
// The flag useForRetrieval indicates if the IPFS node will also be used for storing retrieving deals.
|
||||||
func IpfsClientBlockstore(ipfsMaddr string, useForRetrieval bool) func(helpers.MetricsCtx, fx.Lifecycle, dtypes.ClientFilestore) (dtypes.ClientBlockstore, error) {
|
func IpfsClientBlockstore(ipfsMaddr string, useForRetrieval bool) func(helpers.MetricsCtx, fx.Lifecycle, dtypes.ClientFilestore) (dtypes.ClientBlockstore, error) {
|
||||||
return func(mctx helpers.MetricsCtx, lc fx.Lifecycle, fstore dtypes.ClientFilestore) (dtypes.ClientBlockstore, error) {
|
return func(mctx helpers.MetricsCtx, lc fx.Lifecycle, fstore dtypes.ClientFilestore) (dtypes.ClientBlockstore, error) {
|
||||||
ma, err := multiaddr.NewMultiaddr(ipfsMaddr)
|
var err error
|
||||||
if err != nil {
|
|
||||||
return nil, xerrors.Errorf("parsing ipfs multiaddr: %w", err)
|
|
||||||
}
|
|
||||||
var ipfsbs *ipfsbstore.IpfsBstore
|
var ipfsbs *ipfsbstore.IpfsBstore
|
||||||
if ipfsMaddr != "" {
|
if ipfsMaddr != "" {
|
||||||
|
var ma multiaddr.Multiaddr
|
||||||
|
ma, err = multiaddr.NewMultiaddr(ipfsMaddr)
|
||||||
|
if err != nil {
|
||||||
|
return nil, xerrors.Errorf("parsing ipfs multiaddr: %w", err)
|
||||||
|
}
|
||||||
ipfsbs, err = ipfsbstore.NewRemoteIpfsBstore(helpers.LifecycleCtx(mctx, lc), ma)
|
ipfsbs, err = ipfsbstore.NewRemoteIpfsBstore(helpers.LifecycleCtx(mctx, lc), ma)
|
||||||
} else {
|
} else {
|
||||||
ipfsbs, err = ipfsbstore.NewIpfsBstore(helpers.LifecycleCtx(mctx, lc))
|
ipfsbs, err = ipfsbstore.NewIpfsBstore(helpers.LifecycleCtx(mctx, lc))
|
||||||
|
Loading…
Reference in New Issue
Block a user