aboutsummaryrefslogtreecommitdiffstats
path: root/peer.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <obscuren@users.noreply.github.com>2014-02-19 18:38:02 +0800
committerJeffrey Wilcke <obscuren@users.noreply.github.com>2014-02-19 18:38:02 +0800
commit531b3a96ebc408c00f67cee00ebe7fe192bf0b8c (patch)
tree18cbb9c612c9b1f4785cbc54b12c5e292d6f6627 /peer.go
parent3dae732f36981e279bfd4b28d59711611d6a29af (diff)
parent357b4bc14c82d206a8c813291fb3ead01ed29041 (diff)
downloadgo-tangerine-531b3a96ebc408c00f67cee00ebe7fe192bf0b8c.tar
go-tangerine-531b3a96ebc408c00f67cee00ebe7fe192bf0b8c.tar.gz
go-tangerine-531b3a96ebc408c00f67cee00ebe7fe192bf0b8c.tar.bz2
go-tangerine-531b3a96ebc408c00f67cee00ebe7fe192bf0b8c.tar.lz
go-tangerine-531b3a96ebc408c00f67cee00ebe7fe192bf0b8c.tar.xz
go-tangerine-531b3a96ebc408c00f67cee00ebe7fe192bf0b8c.tar.zst
go-tangerine-531b3a96ebc408c00f67cee00ebe7fe192bf0b8c.zip
Merge pull request #5 from sdboyer/iotas
Idiomatic go: use iotas for const declarations
Diffstat (limited to 'peer.go')
-rw-r--r--peer.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/peer.go b/peer.go
index 95b526c67..ed81ddd8e 100644
--- a/peer.go
+++ b/peer.go
@@ -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
)