diff --git a/go.mod b/go.mod index 24691d51833d6d1cbfb7dfa5755e66b44a0b0985..0d5e6d485cfc66aa506a1fefa30f30cbf1c3999c 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( gitlab.com/elixxir/crypto v0.0.7-0.20220309234716-1ba339865787 gitlab.com/elixxir/ekv v0.1.6 gitlab.com/elixxir/primitives v0.0.3-0.20220222212109-d412a6e46623 - gitlab.com/xx_network/comms v0.0.4-0.20220223205228-7c4974139569 + gitlab.com/xx_network/comms v0.0.4-0.20220311192415-d95fe8906580 gitlab.com/xx_network/crypto v0.0.5-0.20220222212031-750f7e8a01f4 gitlab.com/xx_network/primitives v0.0.4-0.20220222211843-901fa4a2d72b golang.org/x/crypto v0.0.0-20220128200615-198e4374d7ed diff --git a/go.sum b/go.sum index a6c4c7e78ad2a2f0cd8bfdb8b3bcc83a5038c58e..d5504c7a5d85bda9142d40c5dd364953fd617a98 100644 --- a/go.sum +++ b/go.sum @@ -288,8 +288,9 @@ gitlab.com/elixxir/primitives v0.0.1/go.mod h1:kNp47yPqja2lHSiS4DddTvFpB/4D9dB2Y gitlab.com/elixxir/primitives v0.0.3-0.20220222212109-d412a6e46623 h1:NzJ06KdJd3fVJee0QvGhNr3CO+Ki8Ea1PeakZsm+rZM= gitlab.com/elixxir/primitives v0.0.3-0.20220222212109-d412a6e46623/go.mod h1:MtFIyJUQn9P7djzVlBpEYkPNnnWFTjZvw89swoXY+QM= gitlab.com/xx_network/comms v0.0.0-20200805174823-841427dd5023/go.mod h1:owEcxTRl7gsoM8c3RQ5KAm5GstxrJp5tn+6JfQ4z5Hw= -gitlab.com/xx_network/comms v0.0.4-0.20220223205228-7c4974139569 h1:TjO165sJ6S++ZcHn+u5GnkfCjq3sxfaqhHmB1WgH31s= gitlab.com/xx_network/comms v0.0.4-0.20220223205228-7c4974139569/go.mod h1:isHnwem0v4rTcwwHP455FhVlFyPcHkHiVz+N3s/uCSI= +gitlab.com/xx_network/comms v0.0.4-0.20220311192415-d95fe8906580 h1:IV0gDwdTxtCpc9Vkx7IeSStSqvG+0ZpF57X+OhTQDIM= +gitlab.com/xx_network/comms v0.0.4-0.20220311192415-d95fe8906580/go.mod h1:isHnwem0v4rTcwwHP455FhVlFyPcHkHiVz+N3s/uCSI= gitlab.com/xx_network/crypto v0.0.3/go.mod h1:DF2HYvvCw9wkBybXcXAgQMzX+MiGbFPjwt3t17VRqRE= gitlab.com/xx_network/crypto v0.0.4/go.mod h1:+lcQEy+Th4eswFgQDwT0EXKp4AXrlubxalwQFH5O0Mk= gitlab.com/xx_network/crypto v0.0.5-0.20220222212031-750f7e8a01f4 h1:95dZDMn/hpLNwsgZO9eyQgGKaSDyh6F6+WygqZIciww= diff --git a/network/gateway/hostPool.go b/network/gateway/hostPool.go index eed695bb9a56ebc4ef8ef4e43289e19376593b3f..481cd451314599bec0252bcaadceacbd9a016045 100644 --- a/network/gateway/hostPool.go +++ b/network/gateway/hostPool.go @@ -539,7 +539,7 @@ func (h *HostPool) replaceHostNoStore(newId *id.ID, oldPoolIndex uint32) error { // Use the GwId to keep track of the new random Host's index in the hostList h.hostMap[*newId] = oldPoolIndex - // Clean up and move onto next Host + // Clean up and disconnect old Host oldHostIDStr := "unknown" if oldHost != nil { oldHostIDStr = oldHost.GetId().String() @@ -547,9 +547,16 @@ func (h *HostPool) replaceHostNoStore(newId *id.ID, oldPoolIndex uint32) error { go oldHost.Disconnect() } + // Manually connect the new Host + go func() { + err := newHost.Connect() + if err != nil { + jww.WARN.Printf("Unable to initialize Host connection: %+v", err) + } + }() + jww.DEBUG.Printf("Replaced Host at %d [%s] with new Host %s", oldPoolIndex, oldHostIDStr, newId.String()) - return nil }