コード例 #1
0
 public IActionResult GetPeerInfo()
 {
     try
     {
         return(this.Json(ConnectionManagerRPCController.GetPeerInfo(this.ConnectionManager)));
     }
     catch (Exception e)
     {
         this.logger.LogError("Exception occurred: {0}", e.ToString());
         return(ErrorHelpers.BuildErrorResponse(HttpStatusCode.BadRequest, e.Message, e.ToString()));
     }
 }
コード例 #2
0
        public IActionResult AddNode([FromQuery] string endpoint, string command)
        {
            try
            {
                Guard.NotEmpty(endpoint, nameof(endpoint));
                Guard.NotEmpty(command, nameof(command));

                return(this.Json(ConnectionManagerRPCController.AddNode(this.ConnectionManager, this.peerBanning, endpoint, command)));
            }
            catch (Exception e)
            {
                this.logger.LogError("Exception occurred: {0}", e.ToString());
                return(ErrorHelpers.BuildErrorResponse(HttpStatusCode.BadRequest, e.Message, e.ToString()));
            }
        }