@@ -68,19 +68,20 @@ func (r RoutingPluginType) String() string {
6868}
6969
7070type swapServerClient interface {
71- GetLoopOutTerms (ctx context.Context ) (
71+ GetLoopOutTerms (ctx context.Context , initiator string ) (
7272 * LoopOutTerms , error )
7373
7474 GetLoopOutQuote (ctx context.Context , amt btcutil.Amount , expiry int32 ,
75- swapPublicationDeadline time.Time ) (
75+ swapPublicationDeadline time.Time , initiator string ) (
7676 * LoopOutQuote , error )
7777
78- GetLoopInTerms (ctx context.Context ) (
78+ GetLoopInTerms (ctx context.Context , initiator string ) (
7979 * LoopInTerms , error )
8080
8181 GetLoopInQuote (ctx context.Context , amt btcutil.Amount ,
8282 pubKey route.Vertex , lastHop * route.Vertex ,
83- routeHints [][]zpay32.HopHint ) (* LoopInQuote , error )
83+ routeHints [][]zpay32.HopHint ,
84+ initiator string ) (* LoopInQuote , error )
8485
8586 Probe (ctx context.Context , amt btcutil.Amount , target route.Vertex ,
8687 lastHop * route.Vertex , routeHints [][]zpay32.HopHint ) error
@@ -180,14 +181,15 @@ func newSwapServerClient(cfg *ClientConfig, lsatStore lsat.Store) (
180181 }, nil
181182}
182183
183- func (s * grpcSwapServerClient ) GetLoopOutTerms (ctx context.Context ) (
184- * LoopOutTerms , error ) {
184+ func (s * grpcSwapServerClient ) GetLoopOutTerms (ctx context.Context ,
185+ initiator string ) ( * LoopOutTerms , error ) {
185186
186187 rpcCtx , rpcCancel := context .WithTimeout (ctx , globalCallTimeout )
187188 defer rpcCancel ()
188189 terms , err := s .server .LoopOutTerms (rpcCtx ,
189190 & looprpc.ServerLoopOutTermsRequest {
190191 ProtocolVersion : loopdb .CurrentRPCProtocolVersion (),
192+ UserAgent : UserAgent (initiator ),
191193 },
192194 )
193195 if err != nil {
@@ -203,8 +205,8 @@ func (s *grpcSwapServerClient) GetLoopOutTerms(ctx context.Context) (
203205}
204206
205207func (s * grpcSwapServerClient ) GetLoopOutQuote (ctx context.Context ,
206- amt btcutil.Amount , expiry int32 , swapPublicationDeadline time.Time ) (
207- * LoopOutQuote , error ) {
208+ amt btcutil.Amount , expiry int32 , swapPublicationDeadline time.Time ,
209+ initiator string ) ( * LoopOutQuote , error ) {
208210
209211 rpcCtx , rpcCancel := context .WithTimeout (ctx , globalCallTimeout )
210212 defer rpcCancel ()
@@ -214,6 +216,7 @@ func (s *grpcSwapServerClient) GetLoopOutQuote(ctx context.Context,
214216 SwapPublicationDeadline : swapPublicationDeadline .Unix (),
215217 ProtocolVersion : loopdb .CurrentRPCProtocolVersion (),
216218 Expiry : expiry ,
219+ UserAgent : UserAgent (initiator ),
217220 },
218221 )
219222 if err != nil {
@@ -237,14 +240,15 @@ func (s *grpcSwapServerClient) GetLoopOutQuote(ctx context.Context,
237240 }, nil
238241}
239242
240- func (s * grpcSwapServerClient ) GetLoopInTerms (ctx context.Context ) (
241- * LoopInTerms , error ) {
243+ func (s * grpcSwapServerClient ) GetLoopInTerms (ctx context.Context ,
244+ initiator string ) ( * LoopInTerms , error ) {
242245
243246 rpcCtx , rpcCancel := context .WithTimeout (ctx , globalCallTimeout )
244247 defer rpcCancel ()
245248 terms , err := s .server .LoopInTerms (rpcCtx ,
246249 & looprpc.ServerLoopInTermsRequest {
247250 ProtocolVersion : loopdb .CurrentRPCProtocolVersion (),
251+ UserAgent : UserAgent (initiator ),
248252 },
249253 )
250254 if err != nil {
@@ -259,7 +263,7 @@ func (s *grpcSwapServerClient) GetLoopInTerms(ctx context.Context) (
259263
260264func (s * grpcSwapServerClient ) GetLoopInQuote (ctx context.Context ,
261265 amt btcutil.Amount , pubKey route.Vertex , lastHop * route.Vertex ,
262- routeHints [][]zpay32.HopHint ) (* LoopInQuote , error ) {
266+ routeHints [][]zpay32.HopHint , initiator string ) (* LoopInQuote , error ) {
263267
264268 err := s .Probe (ctx , amt , pubKey , lastHop , routeHints )
265269 if err != nil && status .Code (err ) != codes .Unavailable {
@@ -273,6 +277,7 @@ func (s *grpcSwapServerClient) GetLoopInQuote(ctx context.Context,
273277 Amt : uint64 (amt ),
274278 ProtocolVersion : loopdb .CurrentRPCProtocolVersion (),
275279 Pubkey : pubKey [:],
280+ UserAgent : UserAgent (initiator ),
276281 }
277282
278283 if lastHop != nil {
0 commit comments