lnd: add string representation for peerAccessStatus

This commit is contained in:
yyforyongyu
2025-06-03 23:15:31 +08:00
committed by Olaoluwa Osuntokun
parent bd99924383
commit d170ef3efe

View File

@@ -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 {