title: Both WebRTC peers initiate ICE restart simultaneously
body: <p>I am fairly new to webRTC. The problem pertains to ICE restart. Let's say there are 2 peers connected using webRTC and one of them loses connection. Now, the peer connection will first go into "disconnected" state. And shortly after, if there is still no connection, goes into "failed" state. </p>
  
  <p>Now, I understand once this failed state is reached, I have to perform an ICE restart. The problem is that even though one peer loses connection, both peers will report "failed" state and try to perform ICE restart, which I believe should be problematic. Here is a snippet of the code:</p>
  
  <pre><code>if (peer.localConnection.iceConnectionState == "failed") {
              // create an offer
                  peer.localConnection.createOffer({
                      iceRestart : true
                  }).then(function(offer) {
                      peer.localConnection.setLocalDescription(offer);
                      // forward the offer to the signaling server
                      var msg = createMsg("OFFER", myId, peerId, offer);
                      sendToSignallingServer(msg);
                  }, function(error) {
                      //error
                  });
          }
  </code></pre>
  
  <p>I understand that upon finding that there are now two offers, one of the peers should perform a "rollback" using RTCSessionDescription("rollback"). But I am confused whether this will work or not since both the peers might try to perform rollback.</p>
  
  <p>How I can I make sure that only one peer performs a rollback?</p>