closeIfAllEventsVerified method

void closeIfAllEventsVerified(
  1. RelayRequestState request,
  2. RequestState state,
  3. String url
)

Implementation

void closeIfAllEventsVerified(
    RelayRequestState request, RequestState state, String url) {
  if (request.receivedEOSE && request.eventIdsToBeVerified.isEmpty) {
    if (state.request.closeOnEOSE) {
      sendCloseToRelay(url, state.id);
      if (state.requests.isEmpty || state.didAllRequestsReceivedEOSE) {
        removeInFlightRequest(state);
      }
    }
    state.requests.remove(url);
  }
}