def remaining_max_inflight(self, htlc_receiver: HTLCOwner, *, strict: bool) -> int:
        """
        Checks max_htlc_value_in_flight_msat
        strict = False -> how much we can accept according to BOLT2
        strict = True -> how much the remote will accept to send to us (Eclair has stricter rules)
        """
        ctn = self.get_next_ctn(htlc_receiver)
        current_htlc_sum = htlcsum(self.hm.htlcs_by_direction(htlc_receiver, direction=RECEIVED, ctn=ctn).values())
        max_inflight = self.config[htlc_receiver].max_htlc_value_in_flight_msat
        if strict and htlc_receiver == LOCAL:
            # in order to send, eclair applies both local and remote max values
            # https://github.com/ACINQ/eclair/blob/9b0c00a2a28d3ba6c7f3d01fbd2d8704ebbdc75d/eclair-core/src/main/scala/fr/acinq/eclair/channel/Commitments.scala#L503
            max_inflight = min(
                self.config[LOCAL].max_htlc_value_in_flight_msat,
                self.config[REMOTE].max_htlc_value_in_flight_msat
            )
        return max_inflight - current_htlc_sum

        Checks max_htlc_value_in_flight_msat
        strict = False -> how much we can accept according to BOLT2
        strict = True -> how much the remote will accept to send to us (Eclair has stricter rules)
        
electrum/lnchannel.py