loopd: map static address loop-ins to swap status

This commit is contained in:
Gustavo Stingelin 2026-07-08 23:38:03 -03:00
parent df7dfba12a
commit 34cf98e8e8
No known key found for this signature in database
GPG key ID: 15CBADFE29F2017B
4 changed files with 409 additions and 6 deletions

View file

@ -9,10 +9,13 @@ const (
// TypeOut is a loop out swap.
TypeOut
// TypeStaticAddressLoopIn is a static-address loop-in swap.
TypeStaticAddressLoopIn
)
// IsOut returns true if the swap is a loop out swap, false if it is a loop in
// swap.
// IsOut returns true only if the swap is TypeOut; TypeIn and
// TypeStaticAddressLoopIn both return false.
func (t Type) IsOut() bool {
return t == TypeOut
}
@ -23,6 +26,8 @@ func (t Type) String() string {
return "In"
case TypeOut:
return "Out"
case TypeStaticAddressLoopIn:
return "StaticAddressLoopIn"
default:
return "Unknown"
}