(conn *Conn, info *common.ClientInfo)
| 122 | } |
| 123 | |
| 124 | func readHello(conn *Conn, info *common.ClientInfo) error { |
| 125 | switch msg := conn.Read().(type) { |
| 126 | case *Hello: |
| 127 | // set snappy if version is at least 5 |
| 128 | if msg.Version >= 5 { |
| 129 | conn.SetSnappy(true) |
| 130 | } |
| 131 | info.Capabilities = msg.Caps |
| 132 | info.SoftwareVersion = msg.Version |
| 133 | info.ClientType = msg.Name |
| 134 | |
| 135 | conn.negotiateEthProtocol(info.Capabilities) |
| 136 | |
| 137 | return nil |
| 138 | case *Disconnect: |
| 139 | return fmt.Errorf("bad hello handshake disconnect: %v", msg.Reason.Error()) |
| 140 | case *Error: |
| 141 | return fmt.Errorf("bad hello handshake error: %v", msg.Error()) |
| 142 | default: |
| 143 | return fmt.Errorf("bad hello handshake code: %v", msg.Code()) |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | func getStatus(config *params.ChainConfig, version uint32, genesis *ethTypes.Block, network uint64, nodeURL string) *Status { |
| 148 | if _status == nil { |
no test coverage detected