Skip to content

Commit

Permalink
Added unregistration on stop
Browse files Browse the repository at this point in the history
  • Loading branch information
crioto committed Mar 15, 2018
1 parent 2fcd950 commit bc22544
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func (np *NetworkPeer) stateWaitingToConnect(ptpc *PeerToPeer) error {
recheck := time.Now()
recheckTimeout := time.Duration(5000 * time.Millisecond)
for {
if np.RemoteState == PeerStateWaitingToConnect || np.RemoteState == PeerStateConnecting {
if np.RemoteState == PeerStateWaitingToConnect || np.RemoteState == PeerStateConnecting || np.RemoteState == PeerStateConnected {
Log(Debug, "Peer [%s] have joined required state: %s", np.ID, StringifyState(np.RemoteState))
np.SetState(PeerStateConnecting, ptpc)
break
Expand Down
1 change: 1 addition & 0 deletions stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func (p *Daemon) Stop(args *DaemonArgs, resp *Response) error {
}
}
usedIPs = usedIPs[:k]
bootstrap.unregisterInstance(args.Hash)
return nil
}
} else if args.Dev != "" {
Expand Down

0 comments on commit bc22544

Please sign in to comment.