aboutsummaryrefslogtreecommitdiffstats
path: root/eth/protocol.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-06-29 22:32:14 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-07-01 00:00:01 +0800
commitaac2b6ae4c5cf6f78547159c47f9192babe3e6dd (patch)
tree15a82179744f457c89607f4d115f3dbecf9a2dde /eth/protocol.go
parent5db8f447d597e55718263ba5ed1770290e3e0893 (diff)
downloadgo-tangerine-aac2b6ae4c5cf6f78547159c47f9192babe3e6dd.tar
go-tangerine-aac2b6ae4c5cf6f78547159c47f9192babe3e6dd.tar.gz
go-tangerine-aac2b6ae4c5cf6f78547159c47f9192babe3e6dd.tar.bz2
go-tangerine-aac2b6ae4c5cf6f78547159c47f9192babe3e6dd.tar.lz
go-tangerine-aac2b6ae4c5cf6f78547159c47f9192babe3e6dd.tar.xz
go-tangerine-aac2b6ae4c5cf6f78547159c47f9192babe3e6dd.tar.zst
go-tangerine-aac2b6ae4c5cf6f78547159c47f9192babe3e6dd.zip
eth: add the blocks from numbers protocol message
Diffstat (limited to 'eth/protocol.go')
-rw-r--r--eth/protocol.go29
1 files changed, 26 insertions, 3 deletions
diff --git a/eth/protocol.go b/eth/protocol.go
index 56409721b..bf9e155c5 100644
--- a/eth/protocol.go
+++ b/eth/protocol.go
@@ -28,7 +28,7 @@ const (
GetBlocksMsg
BlocksMsg
NewBlockMsg
- BlockHashesFromNumbers
+ GetBlockHashesFromNumberMsg
)
type errCode int
@@ -77,8 +77,31 @@ type chainManager interface {
Status() (td *big.Int, currentBlock common.Hash, genesisBlock common.Hash)
}
-// message structs used for RLP serialization
-type newBlockMsgData struct {
+// statusData is the network packet for the status message.
+type statusData struct {
+ ProtocolVersion uint32
+ NetworkId uint32
+ TD *big.Int
+ CurrentBlock common.Hash
+ GenesisBlock common.Hash
+}
+
+// getBlockHashesData is the network packet for the hash based block retrieval
+// message.
+type getBlockHashesData struct {
+ Hash common.Hash
+ Amount uint64
+}
+
+// getBlockHashesFromNumberData is the network packet for the number based block
+// retrieval message.
+type getBlockHashesFromNumberData struct {
+ Number uint64
+ Amount uint64
+}
+
+// newBlockData is the network packet for the block propagation message.
+type newBlockData struct {
Block *types.Block
TD *big.Int
}