/// <summary> /// 刷新共识信息 /// </summary> private bool RefreshConsensusInfo() { var consensusInfo = GetNulsNodeInfo.GetConsensusInfo(); if (consensusInfo == null) { return(false); } ; this.Label_AgentCount.Dispatcher.Invoke(new Action(delegate { this.Label_AgentCount.Content = consensusInfo.agentCount.ToString(); })); this.Label_TotalDeposit.Dispatcher.Invoke(new Action(delegate { this.Label_TotalDeposit.Content = (consensusInfo.totalDeposit / 100000000.0).ToString(); })); this.Label_RewardOfDay.Dispatcher.Invoke(new Action(delegate { this.Label_RewardOfDay.Content = (consensusInfo.rewardOfDay / 100000000.0).ToString(); })); this.Label_ConsensusAccountNumber.Dispatcher.Invoke(new Action(delegate { this.Label_ConsensusAccountNumber.Content = consensusInfo.consensusAccountNumber.ToString(); })); return(true); }
/// <summary> /// 刷新区块信息 /// </summary> /// <returns></returns> private bool RefreshBlockInfo() { var blockInfo = GetNulsNodeInfo.GetBlockInfo(); if (blockInfo == null || blockInfo.list == null || blockInfo.list.Length == 0) { return(false); } ; this.LabelBlockHeight.Dispatcher.Invoke(new Action(delegate { this.LabelBlockHeight.Content = blockInfo.list[0].height.ToString(); })); this.LabelBlockTime.Dispatcher.Invoke(new Action(delegate { this.LabelBlockTime.Content = Uitls.DateTimeUitls.GetDateTime(blockInfo.list[0].createTime, true).ToString("yyyy-MM-dd HH:mm:ss"); })); return(true); }