@@ -128,7 +128,7 @@ func (r *RequestLogger) CustomCaveatName() string {
128128
129129// Intercept processes an RPC middleware interception request and returns the
130130// interception result which either accepts or rejects the intercepted message.
131- func (r * RequestLogger ) Intercept (_ context.Context ,
131+ func (r * RequestLogger ) Intercept (ctx context.Context ,
132132 req * lnrpc.RPCMiddlewareRequest ) (* lnrpc.RPCMiddlewareResponse , error ) {
133133
134134 ri , err := NewInfoFromRequest (req )
@@ -156,7 +156,7 @@ func (r *RequestLogger) Intercept(_ context.Context,
156156
157157 // Parse incoming requests and act on them.
158158 case MWRequestTypeRequest :
159- return mid .RPCErr (req , r .addNewAction (ri , withPayloadData ))
159+ return mid .RPCErr (req , r .addNewAction (ctx , ri , withPayloadData ))
160160
161161 // Parse and possibly manipulate outgoing responses.
162162 case MWRequestTypeResponse :
@@ -170,7 +170,7 @@ func (r *RequestLogger) Intercept(_ context.Context,
170170 }
171171
172172 return mid .RPCErr (
173- req , r .MarkAction (ri .RequestID , state , errReason ),
173+ req , r .MarkAction (ctx , ri .RequestID , state , errReason ),
174174 )
175175
176176 default :
@@ -179,7 +179,7 @@ func (r *RequestLogger) Intercept(_ context.Context,
179179}
180180
181181// addNewAction persists the new action to the db.
182- func (r * RequestLogger ) addNewAction (ri * RequestInfo ,
182+ func (r * RequestLogger ) addNewAction (ctx context. Context , ri * RequestInfo ,
183183 withPayloadData bool ) error {
184184
185185 // If no macaroon is provided, then an empty 4-byte array is used as the
@@ -223,7 +223,7 @@ func (r *RequestLogger) addNewAction(ri *RequestInfo,
223223 }
224224 }
225225
226- id , err := r .actionsDB .AddAction (action )
226+ id , err := r .actionsDB .AddAction (ctx , action )
227227 if err != nil {
228228 return err
229229 }
@@ -240,7 +240,7 @@ func (r *RequestLogger) addNewAction(ri *RequestInfo,
240240
241241// MarkAction can be used to set the state of an action identified by the given
242242// requestID.
243- func (r * RequestLogger ) MarkAction (reqID uint64 ,
243+ func (r * RequestLogger ) MarkAction (ctx context. Context , reqID uint64 ,
244244 state firewalldb.ActionState , errReason string ) error {
245245
246246 r .mu .Lock ()
@@ -252,5 +252,5 @@ func (r *RequestLogger) MarkAction(reqID uint64,
252252 }
253253 delete (r .reqIDToAction , reqID )
254254
255- return r .actionsDB .SetActionState (actionLocator , state , errReason )
255+ return r .actionsDB .SetActionState (ctx , actionLocator , state , errReason )
256256}
0 commit comments