diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-08-14 22:48:26 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-08-24 22:57:28 +0800 |
commit | ca88e18f59af84f34ad67da21fd27a6407eea87c (patch) | |
tree | d1943d61c1d6992f1eea83936e420acd639ecb29 /eth/metrics.go | |
parent | 42f44dda5468000b3b2c005ec485529bc5da3674 (diff) | |
download | go-tangerine-ca88e18f59af84f34ad67da21fd27a6407eea87c.tar.gz go-tangerine-ca88e18f59af84f34ad67da21fd27a6407eea87c.tar.zst go-tangerine-ca88e18f59af84f34ad67da21fd27a6407eea87c.zip |
eth: kill off protocol eth/60 in preparation for eth/62
Diffstat (limited to 'eth/metrics.go')
-rw-r--r-- | eth/metrics.go | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/eth/metrics.go b/eth/metrics.go index 778747210..21002094c 100644 --- a/eth/metrics.go +++ b/eth/metrics.go @@ -95,19 +95,19 @@ func (rw *meteredMsgReadWriter) ReadMsg() (p2p.Msg, error) { // Account for the data traffic packets, traffic := miscInPacketsMeter, miscInTrafficMeter switch { - case (rw.version == eth60 || rw.version == eth61) && msg.Code == BlockHashesMsg: + case rw.version < eth62 && msg.Code == BlockHashesMsg: packets, traffic = reqHashInPacketsMeter, reqHashInTrafficMeter - case (rw.version == eth60 || rw.version == eth61) && msg.Code == BlocksMsg: + case rw.version < eth62 && msg.Code == BlocksMsg: packets, traffic = reqBlockInPacketsMeter, reqBlockInTrafficMeter - case rw.version == eth62 && msg.Code == BlockHeadersMsg: + case rw.version >= eth62 && msg.Code == BlockHeadersMsg: packets, traffic = reqBlockInPacketsMeter, reqBlockInTrafficMeter - case rw.version == eth62 && msg.Code == BlockBodiesMsg: + case rw.version >= eth62 && msg.Code == BlockBodiesMsg: packets, traffic = reqBodyInPacketsMeter, reqBodyInTrafficMeter - case rw.version == eth63 && msg.Code == NodeDataMsg: + case rw.version >= eth63 && msg.Code == NodeDataMsg: packets, traffic = reqStateInPacketsMeter, reqStateInTrafficMeter - case rw.version == eth63 && msg.Code == ReceiptsMsg: + case rw.version >= eth63 && msg.Code == ReceiptsMsg: packets, traffic = reqReceiptInPacketsMeter, reqReceiptInTrafficMeter case msg.Code == NewBlockHashesMsg: @@ -127,19 +127,19 @@ func (rw *meteredMsgReadWriter) WriteMsg(msg p2p.Msg) error { // Account for the data traffic packets, traffic := miscOutPacketsMeter, miscOutTrafficMeter switch { - case (rw.version == eth60 || rw.version == eth61) && msg.Code == BlockHashesMsg: + case rw.version < eth62 && msg.Code == BlockHashesMsg: packets, traffic = reqHashOutPacketsMeter, reqHashOutTrafficMeter - case (rw.version == eth60 || rw.version == eth61) && msg.Code == BlocksMsg: + case rw.version < eth62 && msg.Code == BlocksMsg: packets, traffic = reqBlockOutPacketsMeter, reqBlockOutTrafficMeter - case rw.version == eth62 && msg.Code == BlockHeadersMsg: + case rw.version >= eth62 && msg.Code == BlockHeadersMsg: packets, traffic = reqHeaderOutPacketsMeter, reqHeaderOutTrafficMeter - case rw.version == eth62 && msg.Code == BlockBodiesMsg: + case rw.version >= eth62 && msg.Code == BlockBodiesMsg: packets, traffic = reqBodyOutPacketsMeter, reqBodyOutTrafficMeter - case rw.version == eth63 && msg.Code == NodeDataMsg: + case rw.version >= eth63 && msg.Code == NodeDataMsg: packets, traffic = reqStateOutPacketsMeter, reqStateOutTrafficMeter - case rw.version == eth63 && msg.Code == ReceiptsMsg: + case rw.version >= eth63 && msg.Code == ReceiptsMsg: packets, traffic = reqReceiptOutPacketsMeter, reqReceiptOutTrafficMeter case msg.Code == NewBlockHashesMsg: |