aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/peer.go
diff options
context:
space:
mode:
Diffstat (limited to 'p2p/peer.go')
-rw-r--r--p2p/peer.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/p2p/peer.go b/p2p/peer.go
index 025be4ba9..c2c83abfc 100644
--- a/p2p/peer.go
+++ b/p2p/peer.go
@@ -20,8 +20,8 @@ const (
baseProtocolLength = uint64(16)
baseProtocolMaxMsgSize = 10 * 1024 * 1024
- disconnectGracePeriod = 2 * time.Second
pingInterval = 15 * time.Second
+ disconnectGracePeriod = 2 * time.Second
)
const (
@@ -176,6 +176,7 @@ func (p *Peer) politeDisconnect(reason DiscReason) {
func (p *Peer) readLoop() error {
for {
+ p.conn.SetDeadline(time.Now().Add(frameReadTimeout))
msg, err := p.rw.ReadMsg()
if err != nil {
return err