mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-30 01:52:26 +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 {
|
||||
return nil, debugerror.Wrap(err)
|
||||
}
|
||||
if node.Peerstore == nil {
|
||||
node.Peerstore = peer.NewPeerstore()
|
||||
}
|
||||
node.DAG = merkledag.NewDAGService(node.Blocks)
|
||||
node.Pinning, err = pin.LoadPinner(node.Datastore, node.DAG)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user