Skip to content

Commit

Permalink
fix flags
Browse files Browse the repository at this point in the history
  • Loading branch information
mh0lt committed Jul 10, 2024
1 parent 1453b96 commit 10f1ce2
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ func (cn *Peer) StatusFlags() (ret string) {
ret += string([]byte{b})
}
if cn.closed.IsSet() {
ret = "op-"
} else {
ret = "cl-"
} else {
ret = "op-"
}

if cn.requestState.Interested {
Expand All @@ -263,12 +263,14 @@ func (cn *Peer) StatusFlags() (ret string) {
}
c('-')
ret += cn.connectionFlags()
c('-')
if cn.peerInterested {
c('i')
}
if cn.peerChoking {
c('c')
if cn.peerInterested || cn.peerChoking {
c('-')
if cn.peerInterested {
c('i')
}
if cn.peerChoking {
c('c')
}
}
return
}
Expand Down

0 comments on commit 10f1ce2

Please sign in to comment.