State of connection is now three-way choice rather than two booleans

This commit is contained in:
Bryan Boreham committed 2014-09-08 17:30:54 +01:00
1 parent f3cf2b598d
commit 64999d830d
2 files changed
+28 -25

No files matched your search

+4 -3
View File
@@ -165,11 +165,12 @@ type ConnectionMaker struct {
targets map[string]*Target
}
type ConnectionState int
// Information about an address where we may find a peer
type Target struct {
acceptAnyPeer bool // was this address given to us on the command line?
attempting bool // are we currently attempting to connect to this address?
established bool // has the connection been established
acceptAnyPeer bool // was this address given to us on the command line?
state ConnectionState
tryAfter time.Time // next time to try this address
tryInterval time.Duration // backoff time on next failure
attemptCount int