public ClientManager()
        {
            mEventLog              = new EventLog();
            mBlacklist             = new Dictionary <uint, bool>();
            mBlacklist[0xC425E50F] = true;

            mBlocksSubmitted = 0;
            mBlocksAccepted  = 0;

            #region Bitcoin
            MiningTarget bc = new MiningTarget();
            bc.mName               = "Bitcoin";
            bc.mPOWAlgorithm       = HashAlgorithm.DoubleSHA256;
            bc.mWallet             = new WalletInfo();
            bc.mWallet.mRPCAddress = "127.0.0.1";
            bc.mWallet.mRPCPort    = 8332;
            bc.mWallet.mRPCUser    = "******";
            bc.mWallet.mRPCPass    = "******";

            PoolInfo pi = new PoolInfo();
            pi.mName     = "Slush";
            pi.mAddress  = "stratum.bitcoin.cz";
            pi.mPort     = 3333;
            pi.mUser     = "******";
            pi.mPassword = "******";
            bc.mPools.Add(pi);
            #endregion
            #region Bitgem
            MiningTarget bg = new MiningTarget();
            bg.mName               = "Bitgem";
            bg.mPOWAlgorithm       = HashAlgorithm.Scrypt;
            bg.mWallet             = new WalletInfo();
            bg.mWallet.mRPCAddress = "127.0.0.1";
            bg.mWallet.mRPCPort    = 8348;
            bg.mWallet.mRPCUser    = "******";
            bg.mWallet.mRPCPass    = "******";

            pi           = new PoolInfo();
            pi.mName     = "JTeam";
            pi.mAddress  = "us-east.jtcpools.org";
            pi.mPort     = 3365;
            pi.mUser     = "******";
            pi.mPassword = "******";
            bg.mPools.Add(pi);
            #endregion
            #region Gamerscoin
            MiningTarget gc = new MiningTarget();
            gc.mName               = "Gamerscoin";
            gc.mPOWAlgorithm       = HashAlgorithm.Scrypt;
            gc.mWallet             = new WalletInfo();
            gc.mWallet.mRPCAddress = "127.0.0.1";
            gc.mWallet.mRPCPort    = 7332;
            gc.mWallet.mRPCUser    = "******";
            gc.mWallet.mRPCPass    = "******";

            pi           = new PoolInfo();
            pi.mName     = "gamerscoin";
            pi.mAddress  = "gamers-coin.org";
            pi.mPort     = 3333;
            pi.mUser     = "******";
            pi.mPassword = "******";
            gc.mPools.Add(pi);
            #endregion
            #region AllMulti
            MiningTarget multi = new MiningTarget();
            multi.mName         = "Mutli";
            multi.mPOWAlgorithm = HashAlgorithm.Scrypt;

            pi           = new PoolInfo();
            pi.mName     = "WeMineAll";
            pi.mAddress  = "multi2.wemineall.com";
            pi.mPort     = 5555;
            pi.mUser     = "******";
            pi.mPassword = "******";
            multi.mPools.Add(pi);
            #endregion
            #region BBQ
            MiningTarget bbq = new MiningTarget();
            bbq.mName         = "BBQ";
            bbq.mPOWAlgorithm = HashAlgorithm.Scrypt;

            pi           = new PoolInfo();
            pi.mName     = "BBQPool";
            pi.mAddress  = "www.bbqpool.net";
            pi.mPort     = 3333;
            pi.mUser     = "******";
            pi.mPassword = "******";
            bbq.mPools.Add(pi);
            #endregion
            //mMiningTarget = gc;
            //mMiningTarget = bg;
            //mMiningTarget = bc;
            //mMiningTarget = multi;
            mMiningTarget = bbq;

            //mUpstream = new US_Wallet(this);
            //mUpstream.SetHost(mMiningTarget.mWallet.mRPCAddress, mMiningTarget.mWallet.mRPCPort);
            //mUpstream.SetCredentials(mMiningTarget.mWallet.mRPCUser, mMiningTarget.mWallet.mRPCPass);
            mUpstream = new US_Stratum(this);
            mUpstream.SetHost(mMiningTarget.mPools[0].mAddress, mMiningTarget.mPools[0].mPort);
            mUpstream.SetCredentials(mMiningTarget.mPools[0].mUser, mMiningTarget.mPools[0].mPassword);

            //mUpstream = new US_Wallet();
            //mUpstream.SetHost("127.0.0.1", 7332);
            //mUpstream.SetCredentials("rpcuser", "rpcpass");
            //mUpstream = new US_Stratum();
            //mUpstream.SetHost("gamers-coin.org", 3333);
            //mUpstream.SetCredentials("rono.f2mserver", "torque9900");

            mPrevBlocks     = new WorkBlock[5];
            mPrevBlockIndex = 0;

            mMailer          = new Email();
            mClients         = new List <Client>();
            mClientListMutex = new Mutex();
            mListener        = new Listener(80, this);

            mUpdateThread = new Thread(new ThreadStart(Update));

            mHashrate = 0;
            BeginBlock();

            mUpdateThread.Start();
        }
Exemple #2
0
        public ClientManager()
        {
            mEventLog = new EventLog();
            mBlacklist = new Dictionary<uint, bool>();
            mBlacklist[0xC425E50F] = true;

            mBlocksSubmitted = 0;
            mBlocksAccepted = 0;

            #region Bitcoin
            MiningTarget bc = new MiningTarget();
            bc.mName = "Bitcoin";
            bc.mPOWAlgorithm = HashAlgorithm.DoubleSHA256;
            bc.mWallet = new WalletInfo();
            bc.mWallet.mRPCAddress = "127.0.0.1";
            bc.mWallet.mRPCPort = 8332;
            bc.mWallet.mRPCUser = "******";
            bc.mWallet.mRPCPass = "******";

            PoolInfo pi = new PoolInfo();
            pi.mName = "Slush";
            pi.mAddress = "stratum.bitcoin.cz";
            pi.mPort = 3333;
            pi.mUser = "******";
            pi.mPassword = "******";
            bc.mPools.Add(pi);
            #endregion
            #region Bitgem
            MiningTarget bg = new MiningTarget();
            bg.mName = "Bitgem";
            bg.mPOWAlgorithm = HashAlgorithm.Scrypt;
            bg.mWallet = new WalletInfo();
            bg.mWallet.mRPCAddress = "127.0.0.1";
            bg.mWallet.mRPCPort = 8348;
            bg.mWallet.mRPCUser = "******";
            bg.mWallet.mRPCPass = "******";

            pi = new PoolInfo();
            pi.mName = "JTeam";
            pi.mAddress = "us-east.jtcpools.org";
            pi.mPort = 3365;
            pi.mUser = "******";
            pi.mPassword = "******";
            bg.mPools.Add(pi);
            #endregion
            #region Gamerscoin
            MiningTarget gc = new MiningTarget();
            gc.mName = "Gamerscoin";
            gc.mPOWAlgorithm = HashAlgorithm.Scrypt;
            gc.mWallet = new WalletInfo();
            gc.mWallet.mRPCAddress = "127.0.0.1";
            gc.mWallet.mRPCPort = 7332;
            gc.mWallet.mRPCUser = "******";
            gc.mWallet.mRPCPass = "******";

            pi = new PoolInfo();
            pi.mName = "gamerscoin";
            pi.mAddress = "gamers-coin.org";
            pi.mPort = 3333;
            pi.mUser = "******";
            pi.mPassword = "******";
            gc.mPools.Add(pi);
            #endregion
            #region AllMulti
            MiningTarget multi = new MiningTarget();
            multi.mName = "Mutli";
            multi.mPOWAlgorithm = HashAlgorithm.Scrypt;

            pi = new PoolInfo();
            pi.mName = "WeMineAll";
            pi.mAddress = "multi2.wemineall.com";
            pi.mPort = 5555;
            pi.mUser = "******";
            pi.mPassword = "******";
            multi.mPools.Add(pi);
            #endregion
            #region BBQ
            MiningTarget bbq = new MiningTarget();
            bbq.mName = "BBQ";
            bbq.mPOWAlgorithm = HashAlgorithm.Scrypt;

            pi = new PoolInfo();
            pi.mName = "BBQPool";
            pi.mAddress = "www.bbqpool.net";
            pi.mPort = 3333;
            pi.mUser = "******";
            pi.mPassword = "******";
            bbq.mPools.Add(pi);
            #endregion
            //mMiningTarget = gc;
            //mMiningTarget = bg;
            //mMiningTarget = bc;
            //mMiningTarget = multi;
            mMiningTarget = bbq;

            //mUpstream = new US_Wallet(this);
            //mUpstream.SetHost(mMiningTarget.mWallet.mRPCAddress, mMiningTarget.mWallet.mRPCPort);
            //mUpstream.SetCredentials(mMiningTarget.mWallet.mRPCUser, mMiningTarget.mWallet.mRPCPass);
            mUpstream = new US_Stratum(this);
            mUpstream.SetHost(mMiningTarget.mPools[0].mAddress, mMiningTarget.mPools[0].mPort);
            mUpstream.SetCredentials(mMiningTarget.mPools[0].mUser, mMiningTarget.mPools[0].mPassword);

            //mUpstream = new US_Wallet();
            //mUpstream.SetHost("127.0.0.1", 7332);
            //mUpstream.SetCredentials("rpcuser", "rpcpass");
            //mUpstream = new US_Stratum();
            //mUpstream.SetHost("gamers-coin.org", 3333);
            //mUpstream.SetCredentials("rono.f2mserver", "torque9900");

            mPrevBlocks = new WorkBlock[5];
            mPrevBlockIndex = 0;

            mMailer = new Email();
            mClients = new List<Client>();
            mClientListMutex = new Mutex();
            mListener = new Listener(80, this);

            mUpdateThread = new Thread(new ThreadStart(Update));

            mHashrate = 0;
            BeginBlock();

            mUpdateThread.Start();
        }