Browse Source

minor fixes

pull/856/head
Ethan Buchman 7 years ago
parent
commit
af0db599b0
2 changed files with 3 additions and 5 deletions
  1. +2
    -4
      p2p/switch.go
  2. +1
    -1
      rpc/lib/types/types.go

+ 2
- 4
p2p/switch.go View File

@ -507,8 +507,6 @@ func MakeConnectedSwitches(cfg *cfg.P2PConfig, n int, initSwitch func(int, *Swit
return switches
}
var PanicOnAddPeerErr = false
// Connect2Switches will connect switches i and j via net.Pipe().
// Blocks until a conection is established.
// NOTE: caller ensures i and j are within bounds.
@ -519,14 +517,14 @@ func Connect2Switches(switches []*Switch, i, j int) {
doneCh := make(chan struct{})
go func() {
err := switchI.addPeerWithConnection(c1)
if PanicOnAddPeerErr && err != nil {
if err != nil {
panic(err)
}
doneCh <- struct{}{}
}()
go func() {
err := switchJ.addPeerWithConnection(c2)
if PanicOnAddPeerErr && err != nil {
if err != nil {
panic(err)
}
doneCh <- struct{}{}


+ 1
- 1
rpc/lib/types/types.go View File

@ -97,7 +97,7 @@ func NewRPCErrorResponse(id string, code int, msg string, data string) RPCRespon
}
func (resp RPCResponse) String() string {
if resp.Error != nil {
if resp.Error == nil {
return fmt.Sprintf("[%s %v]", resp.ID, resp.Result)
} else {
return fmt.Sprintf("[%s %s]", resp.ID, resp.Error)


Loading…
Cancel
Save