Esempio n. 1
0
 /// <summary>
 /// 获取最新的区块时间戳
 /// </summary>
 /// <returns></returns>
 public IRpcMethodResult GetLatestBlockTimestamp()
 {
     try
     {
         BlockComponent block     = new BlockComponent();
         long           timestamp = block.GetLatestBlockTimestamp();
         return(Ok(timestamp));
     }
     catch (CommonException ce)
     {
         return(Error(ce.ErrorCode, ce.Message, ce));
     }
     catch (Exception ex)
     {
         return(Error(ErrorCode.UNKNOWN_ERROR, ex.Message, ex));
     }
 }