public static PoolProfile Create(INTMinerRoot root, Guid poolIdId) { if (root.PoolSet.TryGetPool(poolIdId, out IPool pool)) { PoolProfile coinProfile = new PoolProfile(root, pool); return(coinProfile); } else { return(Empty); } }
public IPoolProfile GetPoolProfile(Guid poolId) { if (_dicById.ContainsKey(poolId)) { return(_dicById[poolId]); } lock (_locker) { if (_dicById.ContainsKey(poolId)) { return(_dicById[poolId]); } PoolProfile coinProfile = PoolProfile.Create(_root, _mineWorkData, poolId); _dicById.Add(poolId, coinProfile); return(coinProfile); } }
public static PoolProfile Create(INTMinerRoot root, MineWorkData mineWorkData, Guid poolIdId) { if (root.PoolSet.TryGetPool(poolIdId, out IPool pool)) { var data = GetPoolProfileData(root, mineWorkData, pool.GetId()); if (data == null) { data = PoolProfileData.CreateDefaultData(pool); } PoolProfile coinProfile = new PoolProfile(mineWorkData, data); return(coinProfile); } else { return(Empty); } }
public static PoolProfile Create(INTMinerContext ntminerContext, Guid poolIdId) { if (ntminerContext.ServerContext.PoolSet.TryGetPool(poolIdId, out IPool pool)) { var data = GetPoolProfileData(ntminerContext, pool.GetId()); if (data == null) { data = PoolProfileData.CreateDefaultData(pool); } PoolProfile coinProfile = new PoolProfile(data); return(coinProfile); } else { return(Empty); } }
public void SetPoolProfileProperty(Guid poolId, string propertyName, object value) { PoolProfile coinProfile = (PoolProfile)GetPoolProfile(poolId); coinProfile.SetValue(propertyName, value); }