diff options
author | obscuren <geffobscura@gmail.com> | 2014-08-21 20:47:58 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-08-21 20:47:58 +0800 |
commit | eaa2e8900d1036e09b002c4e20fc6e4f9cd031bb (patch) | |
tree | 9a0c4c4b1bda39560c70147c73862d72eff38dd1 /ethwire | |
parent | 79c64f6bca4fcfb257496be22c64f4b2faed7050 (diff) | |
download | dexon-eaa2e8900d1036e09b002c4e20fc6e4f9cd031bb.tar.gz dexon-eaa2e8900d1036e09b002c4e20fc6e4f9cd031bb.tar.zst dexon-eaa2e8900d1036e09b002c4e20fc6e4f9cd031bb.zip |
PoC 6 networking code.
* Added block pool for gathering blocks from the network (chunks)
* Re wrote syncing
Diffstat (limited to 'ethwire')
-rw-r--r-- | ethwire/messaging.go | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/ethwire/messaging.go b/ethwire/messaging.go index d114a1c9d..7ac0188a1 100644 --- a/ethwire/messaging.go +++ b/ethwire/messaging.go @@ -27,33 +27,41 @@ const ( // Values are given explicitly instead of by iota because these values are // defined by the wire protocol spec; it is easier for humans to ensure // correctness when values are explicit. - MsgHandshakeTy = 0x00 - MsgDiscTy = 0x01 - MsgPingTy = 0x02 - MsgPongTy = 0x03 - MsgGetPeersTy = 0x10 - MsgPeersTy = 0x11 - MsgTxTy = 0x12 - MsgBlockTy = 0x13 - MsgGetChainTy = 0x14 - MsgNotInChainTy = 0x15 - MsgGetTxsTy = 0x16 + MsgHandshakeTy = 0x00 + MsgDiscTy = 0x01 + MsgPingTy = 0x02 + MsgPongTy = 0x03 + MsgGetPeersTy = 0x10 + MsgPeersTy = 0x11 + MsgTxTy = 0x12 + MsgGetChainTy = 0x14 + MsgNotInChainTy = 0x15 + MsgGetTxsTy = 0x16 + MsgGetBlockHashesTy = 0x17 + MsgBlockHashesTy = 0x18 + MsgGetBlocksTy = 0x19 + MsgBlockTy = 0x13 + + MsgOldBlockTy = 0xbb MsgTalkTy = 0xff ) var msgTypeToString = map[MsgType]string{ - MsgHandshakeTy: "Handshake", - MsgDiscTy: "Disconnect", - MsgPingTy: "Ping", - MsgPongTy: "Pong", - MsgGetPeersTy: "Get peers", - MsgPeersTy: "Peers", - MsgTxTy: "Transactions", - MsgBlockTy: "Blocks", - MsgGetChainTy: "Get chain", - MsgGetTxsTy: "Get Txs", - MsgNotInChainTy: "Not in chain", + MsgHandshakeTy: "Handshake", + MsgDiscTy: "Disconnect", + MsgPingTy: "Ping", + MsgPongTy: "Pong", + MsgGetPeersTy: "Get peers", + MsgPeersTy: "Peers", + MsgTxTy: "Transactions", + MsgBlockTy: "Blocks", + MsgGetChainTy: "Get chain", + MsgGetTxsTy: "Get Txs", + MsgNotInChainTy: "Not in chain", + MsgGetBlockHashesTy: "Get block hashes", + MsgBlockHashesTy: "Block hashes", + MsgGetBlocksTy: "Get blocks", } func (mt MsgType) String() string { |