Exemplo n.º 1
0
        public NodeConnection(Bitcoin owner, string nodeAddress, ushort port = 8333, uint protocolVersion = 0x00011171, uint networkID = 0xD9B4BEF9)
        {
            mOwner = owner;
            mProtocolVersion = protocolVersion;
            mPort = port;
            mNetworkID = networkID;

            mPacketProcessors = new Dictionary<string, PacketProcessor>();
            mPacketProcessors.Add("version", PH_Version);
            mPacketProcessors.Add("verack", PH_Verack);
            mPacketProcessors.Add("addr", PH_Addr);
            mPacketProcessors.Add("inv", PH_Inv);
            mPacketProcessors.Add("getdata", PH_GetData);
            mPacketProcessors.Add("notfound", PH_NotFound);
            mPacketProcessors.Add("getblocks", PH_GetBlocks);
            mPacketProcessors.Add("getheaders", PH_GetHeaders);
            mPacketProcessors.Add("tx", PH_Tx);
            mPacketProcessors.Add("block", PH_Block);
            mPacketProcessors.Add("headers", PH_Headers);
            mPacketProcessors.Add("getaddr", PH_GetAddr);
            mPacketProcessors.Add("mempool", PH_Mempool);
            mPacketProcessors.Add("checkorder", PH_CheckOrder);
            mPacketProcessors.Add("submitorder", PH_Subimtorder);
            mPacketProcessors.Add("reply", PH_Reply);
            mPacketProcessors.Add("ping", PH_Ping);
            mPacketProcessors.Add("pong", PH_Pong);
            mPacketProcessors.Add("alert", PH_Alert);

            mThread = new Thread(new ThreadStart(ReadSocket));

            mSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            Connect(nodeAddress, port);
        }
        public NodeConnection(Bitcoin owner, string nodeAddress, ushort port = 8333, uint protocolVersion = 0x00011171, uint networkID = 0xD9B4BEF9)
        {
            mOwner           = owner;
            mProtocolVersion = protocolVersion;
            mPort            = port;
            mNetworkID       = networkID;

            mPacketProcessors = new Dictionary <string, PacketProcessor>();
            mPacketProcessors.Add("version", PH_Version);
            mPacketProcessors.Add("verack", PH_Verack);
            mPacketProcessors.Add("addr", PH_Addr);
            mPacketProcessors.Add("inv", PH_Inv);
            mPacketProcessors.Add("getdata", PH_GetData);
            mPacketProcessors.Add("notfound", PH_NotFound);
            mPacketProcessors.Add("getblocks", PH_GetBlocks);
            mPacketProcessors.Add("getheaders", PH_GetHeaders);
            mPacketProcessors.Add("tx", PH_Tx);
            mPacketProcessors.Add("block", PH_Block);
            mPacketProcessors.Add("headers", PH_Headers);
            mPacketProcessors.Add("getaddr", PH_GetAddr);
            mPacketProcessors.Add("mempool", PH_Mempool);
            mPacketProcessors.Add("checkorder", PH_CheckOrder);
            mPacketProcessors.Add("submitorder", PH_Subimtorder);
            mPacketProcessors.Add("reply", PH_Reply);
            mPacketProcessors.Add("ping", PH_Ping);
            mPacketProcessors.Add("pong", PH_Pong);
            mPacketProcessors.Add("alert", PH_Alert);

            mThread = new Thread(new ThreadStart(ReadSocket));

            mSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            Connect(nodeAddress, port);
        }
Exemplo n.º 3
0
        public Currency()
        {
            mBC = new Bitcoin();
            mBC.mHistoryTime = 24 * 60 * 60;        // 1 day
            mStatus          = "";

            mThread = new Thread(new ThreadStart(ThreadUpdateFunction));
            mThread.Start();
        }
Exemplo n.º 4
0
        public Currency()
        {
            mBC = new Bitcoin();
            mBC.mHistoryTime = 24 * 60 * 60;        // 1 day
            mStatus = "";

            mThread = new Thread(new ThreadStart(ThreadUpdateFunction));
            mThread.Start();
        }