@@ -788,7 +788,8 @@ func (r *rpcServer) addDeps(s *server, macService *macaroons.Service,
788788 s .sweeper , tower , s .towerClientMgr , r .cfg .net .ResolveTCPAddr ,
789789 genInvoiceFeatures , genAmpInvoiceFeatures ,
790790 s .getNodeAnnouncement , s .updateAndBrodcastSelfNode , parseAddr ,
791- rpcsLog , s .aliasMgr , invoiceHtlcModifier ,
791+ rpcsLog , s .aliasMgr , r .implCfg .AuxDataParser ,
792+ invoiceHtlcModifier ,
792793 )
793794 if err != nil {
794795 return err
@@ -6117,6 +6118,19 @@ func (r *rpcServer) LookupInvoice(ctx context.Context,
61176118 return nil , err
61186119 }
61196120
6121+ // Give the aux data parser a chance to format the custom data in the
6122+ // invoice HTLCs.
6123+ err = fn .MapOptionZ (
6124+ r .server .implCfg .AuxDataParser ,
6125+ func (parser AuxDataParser ) error {
6126+ return parser .InlineParseCustomData (rpcInvoice )
6127+ },
6128+ )
6129+ if err != nil {
6130+ return nil , fmt .Errorf ("error parsing custom data: %w" ,
6131+ err )
6132+ }
6133+
61206134 return rpcInvoice , nil
61216135}
61226136
@@ -6172,6 +6186,21 @@ func (r *rpcServer) ListInvoices(ctx context.Context,
61726186 if err != nil {
61736187 return nil , err
61746188 }
6189+
6190+ // Give the aux data parser a chance to format the custom data
6191+ // in the invoice HTLCs.
6192+ err = fn .MapOptionZ (
6193+ r .server .implCfg .AuxDataParser ,
6194+ func (parser AuxDataParser ) error {
6195+ return parser .InlineParseCustomData (
6196+ resp .Invoices [i ],
6197+ )
6198+ },
6199+ )
6200+ if err != nil {
6201+ return nil , fmt .Errorf ("error parsing custom data: %w" ,
6202+ err )
6203+ }
61756204 }
61766205
61776206 return resp , nil
@@ -6200,6 +6229,21 @@ func (r *rpcServer) SubscribeInvoices(req *lnrpc.InvoiceSubscription,
62006229 return err
62016230 }
62026231
6232+ // Give the aux data parser a chance to format the
6233+ // custom data in the invoice HTLCs.
6234+ err = fn .MapOptionZ (
6235+ r .server .implCfg .AuxDataParser ,
6236+ func (parser AuxDataParser ) error {
6237+ return parser .InlineParseCustomData (
6238+ rpcInvoice ,
6239+ )
6240+ },
6241+ )
6242+ if err != nil {
6243+ return fmt .Errorf ("error parsing custom data: " +
6244+ "%w" , err )
6245+ }
6246+
62036247 if err := updateStream .Send (rpcInvoice ); err != nil {
62046248 return err
62056249 }
@@ -6212,6 +6256,21 @@ func (r *rpcServer) SubscribeInvoices(req *lnrpc.InvoiceSubscription,
62126256 return err
62136257 }
62146258
6259+ // Give the aux data parser a chance to format the
6260+ // custom data in the invoice HTLCs.
6261+ err = fn .MapOptionZ (
6262+ r .server .implCfg .AuxDataParser ,
6263+ func (parser AuxDataParser ) error {
6264+ return parser .InlineParseCustomData (
6265+ rpcInvoice ,
6266+ )
6267+ },
6268+ )
6269+ if err != nil {
6270+ return fmt .Errorf ("error parsing custom data: " +
6271+ "%w" , err )
6272+ }
6273+
62156274 if err := updateStream .Send (rpcInvoice ); err != nil {
62166275 return err
62176276 }
0 commit comments