@cryptotaxi247 / kubo / commits / 8e42e86d8

hack(core): instantiate peerstore at the end if it hasn't already been instantiated

this is a dirty hack

Brian Tiger Chow committed Jan 10, 2015 at 23:26 UTC 8e42e86d874946a34affac4ea2a198d656b2cb06
1 file changed +3
core/core.go
+3
@@ -105,6 +105,9 @@ func NewIPFSNode(ctx context.Context, option ConfigOption) (*IpfsNode, error) {
105 if err != nil {
106 return nil, debugerror.Wrap(err)
107 }
108 + if node.Peerstore == nil {
109 + node.Peerstore = peer.NewPeerstore()
110 + }
111 node.DAG = merkledag.NewDAGService(node.Blocks)
112 node.Pinning, err = pin.LoadPinner(node.Datastore, node.DAG)
113 if err != nil {