Fabcoin Core  0.16.2
P2P Digital Currency
CommonNet.h
Go to the documentation of this file.
1 /*
2  This file is part of cpp-ethereum.
3 
4  cpp-ethereum is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  cpp-ethereum is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
16 */
24 #pragma once
25 
26 #include <string>
27 #include <chrono>
28 #include <libdevcore/Common.h>
29 #include <libdevcore/Log.h>
30 
31 namespace dev
32 {
33 
34 class OverlayDB;
35 
36 namespace eth
37 {
38 
39 #if ETH_DEBUG
40 static const unsigned c_maxHeaders = 2048;
41 static const unsigned c_maxHeadersAsk = 2048;
42 static const unsigned c_maxBlocks = 128;
43 static const unsigned c_maxBlocksAsk = 128;
44 static const unsigned c_maxPayload = 262144;
45 #else
46 static const unsigned c_maxHeaders = 2048;
47 static const unsigned c_maxHeadersAsk = 2048;
48 static const unsigned c_maxBlocks = 128;
49 static const unsigned c_maxBlocksAsk = 128;
50 static const unsigned c_maxPayload = 262144;
51 #endif
52 static const unsigned c_maxNodes = c_maxBlocks;
53 static const unsigned c_maxReceipts = c_maxBlocks;
54 
55 class BlockChain;
56 class TransactionQueue;
57 class EthereumHost;
58 class EthereumPeer;
59 
61 {
62  StatusPacket = 0x00,
70 
75 
77 };
78 
79 enum class Asking
80 {
81  State,
84  NodeData,
85  Receipts,
86  Nothing
87 };
88 
89 enum class SyncState
90 {
91  NotSynced,
92  Idle,
93  Waiting,
94  Blocks,
95  State,
96  NewBlocks,
97 
98  Size
99 };
100 
102 {
104  unsigned protocolVersion = 0;
108  bool majorSyncing = false;
109 };
110 
111 }
112 }
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
Definition: Arith256.cpp:15
unsigned startBlockNumber
Definition: CommonNet.h:105
uint8_t byte
Definition: Common.h:57
Downloading blocks.
Initial chain sync complete. Waiting for new packets.
Initial chain sync has not started yet.
Must be kept last.
SubprotocolPacketType
Definition: CommonNet.h:60
unsigned currentBlockNumber
Definition: CommonNet.h:106
Block downloading paused. Waiting for block queue to process blocks and free space.
unsigned highestBlockNumber
Definition: CommonNet.h:107
Downloading blocks learned from NewHashes packet.