public PoolProfileViewModel GetOrCreatePoolProfile(Guid poolId, string userName, string password) { if (_poolProfileDicById.ContainsKey(poolId)) { return(_poolProfileDicById[poolId]); } PoolProfileViewModel poolProfile = new PoolProfileViewModel(NTMinerRoot.Current.PoolProfileSet.GetPoolProfile(poolId)); poolProfile.UserName = userName; poolProfile.Password = password; _poolProfileDicById.Add(poolId, poolProfile); return(poolProfile); }
public PoolProfileViewModel GetOrCreatePoolProfile(Guid poolId) { PoolProfileViewModel poolProfile; if (!_dicById.TryGetValue(poolId, out poolProfile)) { lock (_locker) { if (!_dicById.TryGetValue(poolId, out poolProfile)) { poolProfile = new PoolProfileViewModel(NTMinerRoot.Current.MinerProfile.GetPoolProfile(poolId)); _dicById.Add(poolId, poolProfile); } } } return(poolProfile); }