@@ -2,6 +2,7 @@ package main
22
33import (
44 "context"
5+ "encoding/json"
56 "fmt"
67
78 "github.com/lightninglabs/loop"
3132 "with our reserved prefix: %v." ,
3233 labels .MaxLength , labels .Reserved ),
3334 }
35+ routeHintsFlag = cli.StringSliceFlag {
36+ Name : "route_hints" ,
37+ Usage : "Route hints that can each be individually used " +
38+ "to assist in reaching the invoice's destination." ,
39+ }
3440
3541 loopInCommand = cli.Command {
3642 Name : "in" ,
6167 lastHopFlag ,
6268 labelFlag ,
6369 verboseFlag ,
70+ routeHintsFlag ,
6471 },
6572 Action : loopIn ,
6673 }
@@ -120,12 +127,20 @@ func loopIn(ctx *cli.Context) error {
120127
121128 lastHop = lastHopVertex [:]
122129 }
130+ var hints []* looprpc.RouteHint
131+ if ctx .IsSet (routeHints .Name ) {
132+ err = json .Unmarshal ([]byte (ctx .String (routeHints .Name )), & hints )
133+ if err != nil {
134+ return fmt .Errorf ("unable to parse json: %v" , err )
135+ }
136+ }
123137
124138 quoteReq := & looprpc.QuoteRequest {
125- Amt : int64 (amt ),
126- ConfTarget : htlcConfTarget ,
127- ExternalHtlc : external ,
128- LoopInLastHop : lastHop ,
139+ Amt : int64 (amt ),
140+ ConfTarget : htlcConfTarget ,
141+ ExternalHtlc : external ,
142+ LoopInLastHop : lastHop ,
143+ LoopInRouteHints : hints ,
129144 }
130145
131146 quote , err := client .GetLoopInQuote (context .Background (), quoteReq )
0 commit comments