示例#1
0
        public void RefreshAsync(string accountId)
        {
            PosNode node;

            if (AllNodes.ContainsKey(accountId))
            {
                node             = AllNodes[accountId];
                node.LastStaking = DateTime.Now;
            }
        }
示例#2
0
        public PosNode Add(PosNode node)
        {
            if (!AllNodes.ContainsKey(node.AccountID))
            {
                AllNodes.Add(node.AccountID, node);
            }
            else
            {
                AllNodes[node.AccountID].IPAddress = node.IPAddress;      // support for dynamic IP address
            }

            node.LastStaking = DateTime.Now;

            return(node);
        }
示例#3
0
        public async Task <PosNode> AddAsync(PosNode node)
        {
            if (!AllNodes.ContainsKey(node.AccountID))
            {
                AllNodes.Add(node.AccountID, node);
            }
            else
            {
                AllNodes[node.AccountID].IP = node.IP;      // support for dynamic IP address
            }

            node.LastStaking = DateTime.Now;

            // lookup balance
            var block = await BlockChain.Singleton.FindLatestBlockAsync(node.AccountID);

            if (block != null && block.Balances != null && block.Balances.ContainsKey(LyraGlobal.LYRATICKERCODE))
            {
                node.Balance = block.Balances[LyraGlobal.LYRATICKERCODE];
            }

            return(node);
        }
示例#4
0
 public bool HasNode(string accountId)
 {
     return(AllNodes.ContainsKey(accountId));
 }