From d170ef3efeff650c981ffc8e028e5850929561b2 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Tue, 3 Jun 2025 23:15:31 +0800 Subject: [PATCH] lnd: add string representation for `peerAccessStatus` --- server.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/server.go b/server.go index 639493da6..f6451fedc 100644 --- a/server.go +++ b/server.go @@ -193,6 +193,23 @@ const ( peerStatusProtected ) +// String returns a human-readable representation of the status code. +func (p peerAccessStatus) String() string { + switch p { + case peerStatusRestricted: + return "restricted" + + case peerStatusTemporary: + return "temporary" + + case peerStatusProtected: + return "protected" + + default: + return "unknown" + } +} + // peerSlotStatus determines whether a peer gets access to one of our free // slots or gets to bypass this safety mechanism. type peerSlotStatus struct {