1
0
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:
Brian Tiger Chow
2015-01-10 23:26:29 -08:00
parent 707874c3a5
commit 8e42e86d87

View File

@ -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 {