diff options
author | obscuren <geffobscura@gmail.com> | 2014-02-19 18:40:02 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-02-19 18:40:02 +0800 |
commit | 0936e5ccf5c8fc842cbd135c02a6abcd009b4e7f (patch) | |
tree | 9c867dbb5061be01bb040f9bafcf12236679383e /peer.go | |
parent | 24f2b2afc3a848190822c382e6aa31c8ab120f07 (diff) | |
parent | 531b3a96ebc408c00f67cee00ebe7fe192bf0b8c (diff) | |
download | dexon-0936e5ccf5c8fc842cbd135c02a6abcd009b4e7f.tar dexon-0936e5ccf5c8fc842cbd135c02a6abcd009b4e7f.tar.gz dexon-0936e5ccf5c8fc842cbd135c02a6abcd009b4e7f.tar.bz2 dexon-0936e5ccf5c8fc842cbd135c02a6abcd009b4e7f.tar.lz dexon-0936e5ccf5c8fc842cbd135c02a6abcd009b4e7f.tar.xz dexon-0936e5ccf5c8fc842cbd135c02a6abcd009b4e7f.tar.zst dexon-0936e5ccf5c8fc842cbd135c02a6abcd009b4e7f.zip |
Merge branch 'develop' of github.com-obscure:ethereum/eth-go into develop
Conflicts:
ethutil/config.go
Diffstat (limited to 'peer.go')
-rw-r--r-- | peer.go | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -23,6 +23,9 @@ const ( type DiscReason byte 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. DiscReRequested = 0x00 DiscReTcpSysErr = 0x01 DiscBadProto = 0x02 @@ -56,9 +59,9 @@ func (d DiscReason) String() string { type Caps byte const ( - CapPeerDiscTy = 0x01 - CapTxTy = 0x02 - CapChainTy = 0x04 + CapPeerDiscTy = 1 << iota + CapTxTy + CapChainTy CapDefault = CapChainTy | CapTxTy | CapPeerDiscTy ) @@ -285,7 +288,6 @@ func (p *Peer) HandleInbound() { p.lastPong = time.Now().Unix() case ethwire.MsgBlockTy: // Get all blocks and process them - msg.Data = msg.Data var block, lastBlock *ethchain.Block var err error for i := msg.Data.Len() - 1; i >= 0; i-- { @@ -438,7 +440,7 @@ func (p *Peer) Start() { err := p.pushHandshake() if err != nil { - log.Printf("Peer can't send outbound version ack", err) + log.Println("Peer can't send outbound version ack", err) p.Stop() |