looprpc: expose static autoloop output

Extend the public rpc surface for static autoloop integration
without turning the planner on yet. SuggestSwaps responses can
now carry static-address loop-in requests and the new planner
reason for missing static candidates is mapped over rpc.
This commit is contained in:
Boris Nagaev 2026-04-10 23:58:29 -05:00
parent 7cf0a87c2b
commit e467ac932b
No known key found for this signature in database
8 changed files with 201 additions and 110 deletions

View file

@ -933,6 +933,10 @@ type Suggestions struct {
// InSwaps is the set of loop in swaps that we suggest executing.
InSwaps []loop.LoopInRequest
// StaticInSwaps is the set of static-address loop-ins that we suggest
// executing.
StaticInSwaps []loop.StaticAddressLoopInRequest
// DisqualifiedChans maps the set of channels that we do not recommend
// swaps on to the reason that we did not recommend a swap.
DisqualifiedChans map[lnwire.ShortChannelID]Reason

View file

@ -73,6 +73,11 @@ const (
// ReasonCustomChannelData indicates that the channel is not standard
// and should not be used for swaps.
ReasonCustomChannelData
// ReasonStaticLoopInNoCandidate indicates that static loop-in
// autoloop was selected, but no full-deposit static candidate was
// available for the target peer.
ReasonStaticLoopInNoCandidate
)
// String returns a string representation of a reason.
@ -123,6 +128,9 @@ func (r Reason) String() string {
case ReasonLoopInUnreachable:
return "loop in unreachable"
case ReasonStaticLoopInNoCandidate:
return "no static loop-in candidate"
default:
return "unknown"
}