Skip to content

Commit 0f9332b

Browse files
committed
lnd: add string representation for peerAccessStatus
1 parent 0c5bb49 commit 0f9332b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

server.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,23 @@ const (
193193
peerStatusProtected
194194
)
195195

196+
// String returns a human-readable representation of the status code.
197+
func (p peerAccessStatus) String() string {
198+
switch p {
199+
case peerStatusRestricted:
200+
return "restricted"
201+
202+
case peerStatusTemporary:
203+
return "temporary"
204+
205+
case peerStatusProtected:
206+
return "protected"
207+
208+
default:
209+
return "unknown"
210+
}
211+
}
212+
196213
// peerSlotStatus determines whether a peer gets access to one of our free
197214
// slots or gets to bypass this safety mechanism.
198215
type peerSlotStatus struct {

0 commit comments

Comments
 (0)