mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-29 12:41:44 +00:00
Connect2Switches: panic on err
This commit is contained in:
10
switch.go
10
switch.go
@ -491,11 +491,17 @@ func Connect2Switches(switches []*Switch, i, j int) {
|
|||||||
c1, c2 := net.Pipe()
|
c1, c2 := net.Pipe()
|
||||||
doneCh := make(chan struct{})
|
doneCh := make(chan struct{})
|
||||||
go func() {
|
go func() {
|
||||||
switchI.AddPeerWithConnection(c1, false) // AddPeer is blocking, requires handshake.
|
_, err := switchI.AddPeerWithConnection(c1, false) // AddPeer is blocking, requires handshake.
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
doneCh <- struct{}{}
|
doneCh <- struct{}{}
|
||||||
}()
|
}()
|
||||||
go func() {
|
go func() {
|
||||||
switchJ.AddPeerWithConnection(c2, true)
|
_, err := switchJ.AddPeerWithConnection(c2, true)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
doneCh <- struct{}{}
|
doneCh <- struct{}{}
|
||||||
}()
|
}()
|
||||||
<-doneCh
|
<-doneCh
|
||||||
|
Reference in New Issue
Block a user