aboutsummaryrefslogtreecommitdiffstats
path: root/eth/protocol.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-12-15 19:34:06 +0800
committerobscuren <geffobscura@gmail.com>2014-12-15 19:34:06 +0800
commit96272e19a6b7a3163ec53f45e04407e9d2ff8414 (patch)
tree5ee02c968d824bc33790d992b63d107be3bbb6ac /eth/protocol.go
parentbd9088792b0a7bcac00f28289a08bd1b8359316f (diff)
downloadgo-tangerine-96272e19a6b7a3163ec53f45e04407e9d2ff8414.tar
go-tangerine-96272e19a6b7a3163ec53f45e04407e9d2ff8414.tar.gz
go-tangerine-96272e19a6b7a3163ec53f45e04407e9d2ff8414.tar.bz2
go-tangerine-96272e19a6b7a3163ec53f45e04407e9d2ff8414.tar.lz
go-tangerine-96272e19a6b7a3163ec53f45e04407e9d2ff8414.tar.xz
go-tangerine-96272e19a6b7a3163ec53f45e04407e9d2ff8414.tar.zst
go-tangerine-96272e19a6b7a3163ec53f45e04407e9d2ff8414.zip
removed filter manager from base
Diffstat (limited to 'eth/protocol.go')
-rw-r--r--eth/protocol.go43
1 files changed, 22 insertions, 21 deletions
diff --git a/eth/protocol.go b/eth/protocol.go
index 3b5b49696..8cbf6d309 100644
--- a/eth/protocol.go
+++ b/eth/protocol.go
@@ -11,6 +11,25 @@ import (
"github.com/ethereum/go-ethereum/rlp"
)
+const (
+ ProtocolVersion = 49
+ NetworkId = 0
+ ProtocolLength = uint64(8)
+ ProtocolMaxMsgSize = 10 * 1024 * 1024
+)
+
+// eth protocol message codes
+const (
+ StatusMsg = iota
+ GetTxMsg // unused
+ TxMsg
+ GetBlockHashesMsg
+ BlockHashesMsg
+ GetBlocksMsg
+ BlocksMsg
+ NewBlockMsg
+)
+
// ethProtocol represents the ethereum wire protocol
// instance is running on each peer
type ethProtocol struct {
@@ -41,25 +60,6 @@ type blockPool interface {
RemovePeer(peerId string)
}
-const (
- ProtocolVersion = 43
- NetworkId = 0
- ProtocolLength = uint64(8)
- ProtocolMaxMsgSize = 10 * 1024 * 1024
-)
-
-// eth protocol message codes
-const (
- StatusMsg = iota
- GetTxMsg // unused
- TxMsg
- GetBlockHashesMsg
- BlockHashesMsg
- GetBlocksMsg
- BlocksMsg
- NewBlockMsg
-)
-
// message structs used for rlp decoding
type newBlockMsgData struct {
Block *types.Block
@@ -279,9 +279,10 @@ func (self *ethProtocol) handleStatus() error {
return ProtocolError(ErrProtocolVersionMismatch, "%d (!= %d)", status.ProtocolVersion, ProtocolVersion)
}
- self.peer.Infof("Peer is [eth] capable (%d/%d). TD = %v ~ %x", status.ProtocolVersion, status.NetworkId, status.CurrentBlock)
+ self.peer.Infof("Peer is [eth] capable (%d/%d). TD=%v H=%x\n", status.ProtocolVersion, status.NetworkId, status.TD, status.CurrentBlock[:4])
- self.blockPool.AddPeer(status.TD, status.CurrentBlock, self.id, self.requestBlockHashes, self.requestBlocks, self.protoErrorDisconnect)
+ //self.blockPool.AddPeer(status.TD, status.CurrentBlock, self.id, self.requestBlockHashes, self.requestBlocks, self.protoErrorDisconnect)
+ self.peer.Infoln("AddPeer(IGNORED)")
return nil
}