Browse Source

p2p: revert change to routePeer (#6475)

pull/6477/head
Sam Kleinman 4 years ago
committed by GitHub
parent
commit
ee230cd0f6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 12 deletions
  1. +5
    -12
      p2p/router.go

+ 5
- 12
p2p/router.go View File

@ -10,6 +10,7 @@ import (
"time"
"github.com/gogo/protobuf/proto"
"github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/libs/log"
"github.com/tendermint/tendermint/libs/service"
@ -790,27 +791,19 @@ func (r *Router) routePeer(peerID NodeID, conn Connection, sendQueue queue) {
errCh <- r.sendPeer(peerID, conn, sendQueue)
}()
e1 := <-errCh
err := e1
err := <-errCh
_ = conn.Close()
sendQueue.close()
e2 := <-errCh
if err == nil {
if e := <-errCh; err == nil {
// The first err was nil, so we update it with the second err, which may
// or may not be nil.
err = e2
err = e
}
switch err {
case nil, io.EOF:
r.logger.Info("peer disconnected",
"peer", peerID,
"endpoint", conn,
"err", e1,
"err2", e2,
)
r.logger.Info("peer disconnected", "peer", peerID, "endpoint", conn)
default:
r.logger.Error("peer failure", "peer", peerID, "endpoint", conn, "err", err)


Loading…
Cancel
Save