Prevent repetative initalisations in offline mode
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
Jakub Sztandera committed
May 23, 2016 at 20:11 UTC
e76a53717b857c1baa695fa2f001a7cb6b4d9d44
1 file changed
+4
core/core.go
+4
@@ -510,6 +510,10 @@ func (n *IpfsNode) loadFilesRoot() error {
510
// uses it to instantiate a routing system in offline mode.
511
// This is primarily used for offline ipns modifications.
512
func (n *IpfsNode) SetupOfflineRouting() error {
513
+ if n.Routing != nil {
514
+ // Routing was already set up
515
+ return nil
516
+ }
517
err := n.LoadPrivateKey()
518
if err != nil {
519
return err