···127127 for {
128128 action, err := readAction(peer, time.Millisecond*100)
129129 if err != nil {
130130+ // if the error is a timeout, it means the peer hasn't sent an action indicating it wishes to do something so sleep
131131+ // for a little bit to allow for other actions to happen on the connection
130132 var neterr net.Error
131133 if errors.As(err, &neterr) && neterr.Timeout() {
132132- time.Sleep(time.Second)
134134+ time.Sleep(time.Millisecond * 500)
133135 continue
134136 }
135137