rename -> OnlineMode()
because this method doesn't check actual network status
Brian Tiger Chow committed
Nov 6, 2014 at 03:42 UTC
6d89094d41d56e3c17ef5e0363992d9603cf4073
2 files changed
+5
-5
core/commands2/diag.go
+1
-1
@@ -31,7 +31,7 @@ var diagCmd = &cmds.Command{
31
Run: func(res cmds.Response, req cmds.Request) {
32
n := req.Context().Node
33
34
- if !n.Online() {
34
+ if !n.OnlineMode() {
35
res.SetError(errors.New("Cannot run diagnostic in offline mode!"), cmds.ErrNormal)
36
return
37
}
core/core.go
+4
-4
@@ -75,7 +75,7 @@ type IpfsNode struct {
75
76
ctxc.ContextCloser
77
78
- online bool // alternatively, offline
78
+ onlineMode bool // alternatively, offline
79
}
80
81
// NewIpfsNode constructs a new IpfsNode based on the given config.
@@ -94,7 +94,7 @@ func NewIpfsNode(cfg *config.Config, online bool) (n *IpfsNode, err error) {
94
// derive this from a higher context.
95
ctx := context.TODO()
96
n = &IpfsNode{
97
- online: online,
97
+ onlineMode: online,
98
Config: cfg,
99
ContextCloser: ctxc.NewContextCloser(ctx, nil),
100
}
@@ -175,8 +175,8 @@ func NewIpfsNode(cfg *config.Config, online bool) (n *IpfsNode, err error) {
175
return n, nil
176
}
177
178
-func (n *IpfsNode) Online() bool {
179
- return n.online
178
+func (n *IpfsNode) OnlineMode() bool {
179
+ return n.onlineMode
180
}
181
182
func initIdentity(cfg *config.Config, peers peer.Peerstore, online bool) (peer.Peer, error) {