mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-31 20:21:56 +00:00
minor fixes
This commit is contained in:
@@ -507,8 +507,6 @@ func MakeConnectedSwitches(cfg *cfg.P2PConfig, n int, initSwitch func(int, *Swit
|
|||||||
return switches
|
return switches
|
||||||
}
|
}
|
||||||
|
|
||||||
var PanicOnAddPeerErr = false
|
|
||||||
|
|
||||||
// Connect2Switches will connect switches i and j via net.Pipe().
|
// Connect2Switches will connect switches i and j via net.Pipe().
|
||||||
// Blocks until a conection is established.
|
// Blocks until a conection is established.
|
||||||
// NOTE: caller ensures i and j are within bounds.
|
// NOTE: caller ensures i and j are within bounds.
|
||||||
@@ -519,14 +517,14 @@ func Connect2Switches(switches []*Switch, i, j int) {
|
|||||||
doneCh := make(chan struct{})
|
doneCh := make(chan struct{})
|
||||||
go func() {
|
go func() {
|
||||||
err := switchI.addPeerWithConnection(c1)
|
err := switchI.addPeerWithConnection(c1)
|
||||||
if PanicOnAddPeerErr && err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
doneCh <- struct{}{}
|
doneCh <- struct{}{}
|
||||||
}()
|
}()
|
||||||
go func() {
|
go func() {
|
||||||
err := switchJ.addPeerWithConnection(c2)
|
err := switchJ.addPeerWithConnection(c2)
|
||||||
if PanicOnAddPeerErr && err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
doneCh <- struct{}{}
|
doneCh <- struct{}{}
|
||||||
|
@@ -97,7 +97,7 @@ func NewRPCErrorResponse(id string, code int, msg string, data string) RPCRespon
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (resp RPCResponse) String() string {
|
func (resp RPCResponse) String() string {
|
||||||
if resp.Error != nil {
|
if resp.Error == nil {
|
||||||
return fmt.Sprintf("[%s %v]", resp.ID, resp.Result)
|
return fmt.Sprintf("[%s %v]", resp.ID, resp.Result)
|
||||||
} else {
|
} else {
|
||||||
return fmt.Sprintf("[%s %s]", resp.ID, resp.Error)
|
return fmt.Sprintf("[%s %s]", resp.ID, resp.Error)
|
||||||
|
Reference in New Issue
Block a user