use super::*;

impl RPCProcessor {
    #[cfg_attr(feature="verbose-tracing", instrument(level = "trace", skip(self, msg), fields(msg.operation.op_id), err))]
    pub(crate) async fn process_value_changed(
        &self,
        msg: RPCMessage,
    ) -> Result<NetworkResult<()>, RPCError> {
        // Ignore if disabled
        let routing_table = self.routing_table();
        {
            if let Some(opi) = routing_table.get_own_peer_info(msg.header.routing_domain()) {
                if !opi.signed_node_info().node_info().has_capability(CAP_DHT) {
                    return Ok(NetworkResult::service_unavailable("dht is not available"));
                }
            }
        }
        Err(RPCError::unimplemented("process_value_changed"))
    }
}
