mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-29 09:34:03 +08:00
hack(core): instantiate peerstore at the end if it hasn't already been instantiated
this is a dirty hack
This commit is contained in:
@ -105,6 +105,9 @@ func NewIPFSNode(ctx context.Context, option ConfigOption) (*IpfsNode, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, debugerror.Wrap(err)
|
return nil, debugerror.Wrap(err)
|
||||||
}
|
}
|
||||||
|
if node.Peerstore == nil {
|
||||||
|
node.Peerstore = peer.NewPeerstore()
|
||||||
|
}
|
||||||
node.DAG = merkledag.NewDAGService(node.Blocks)
|
node.DAG = merkledag.NewDAGService(node.Blocks)
|
||||||
node.Pinning, err = pin.LoadPinner(node.Datastore, node.DAG)
|
node.Pinning, err = pin.LoadPinner(node.Datastore, node.DAG)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user