From 1d7baff8c42dad2a5beb1c3ce2e91e76e289dce8 Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Wed, 28 Nov 2018 00:39:31 -0800 Subject: [PATCH] print # of retry when sending packet via socket Signed-off-by: Leo Chen --- p2p/peer.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/p2p/peer.go b/p2p/peer.go index 78b59a805..78fd6e1ef 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -135,6 +135,9 @@ func send(ip, port string, message []byte) { for trial := 0; trial < 10; trial++ { err := sendWithSocketClient(ip, port, message) if err == nil { + if trial > 0 { + log.Warn("retry sendWithSocketClient", "rety", trial) + } return } log.Info("sleeping before trying to send again",