@@ -166,8 +166,13 @@ func (s *AuxInvoiceManager) handleInvoiceAccept(ctx context.Context,
166
166
return nil , fmt .Errorf ("unable to decode response: %w" , err )
167
167
}
168
168
169
- log .Debugf ("Received invoice: %s" , jsonBytes )
170
- log .Debugf ("Received wire custom records: %v" ,
169
+ iLog := log .WithPrefix (
170
+ fmt .Sprintf ("Invoice(hash=%x, amt=%v): " ,
171
+ req .Invoice .RHash , req .Invoice .Value ),
172
+ )
173
+
174
+ iLog .Debugf ("received invoice: %s" , jsonBytes )
175
+ iLog .Debugf ("received wire custom records: %v" ,
171
176
limitSpewer .Sdump (req .WireCustomRecords ))
172
177
173
178
// Check if any strict forwarding rules need to be applied. Strict
@@ -186,7 +191,12 @@ func (s *AuxInvoiceManager) handleInvoiceAccept(ctx context.Context,
186
191
//
187
192
// TODO(george): Strict-forwarding could be configurable?
188
193
if isAssetInvoice (req .Invoice , s ) {
194
+ iLog .Debugf ("has no asset custom records, but " +
195
+ "invoice requires assets, canceling HTLCs" )
196
+
189
197
resp .CancelSet = true
198
+ } else {
199
+ iLog .Tracef ("has no asset custom records, ignoring" )
190
200
}
191
201
192
202
return resp , nil
@@ -198,6 +208,9 @@ func (s *AuxInvoiceManager) handleInvoiceAccept(ctx context.Context,
198
208
// Since we requested btc we should be receiving btc.
199
209
resp .CancelSet = true
200
210
211
+ iLog .Debugf ("has asset custom records, but invoice does not " +
212
+ "require assets, canceling HTLCs" )
213
+
201
214
return resp , nil
202
215
203
216
default :
@@ -209,7 +222,7 @@ func (s *AuxInvoiceManager) handleInvoiceAccept(ctx context.Context,
209
222
return nil , fmt .Errorf ("unable to decode htlc: %w" , err )
210
223
}
211
224
212
- log .Debugf ("Received htlc: %v" , limitSpewer .Sdump (htlc ))
225
+ iLog .Debugf ("received htlc: %v" , limitSpewer .Sdump (htlc ))
213
226
214
227
// If we don't have an RFQ ID, then this is likely a keysend payment,
215
228
// and we don't modify the amount (since the invoice amount will match
@@ -221,7 +234,7 @@ func (s *AuxInvoiceManager) handleInvoiceAccept(ctx context.Context,
221
234
// We now run some validation checks on the asset HTLC.
222
235
err = s .validateAssetHTLC (ctx , htlc , resp .CircuitKey )
223
236
if err != nil {
224
- log .Errorf ("Failed to validate asset HTLC: %v" , err )
237
+ iLog .Errorf ("failed to validate asset HTLC: %v" , err )
225
238
226
239
resp .CancelSet = true
227
240
@@ -266,7 +279,7 @@ func (s *AuxInvoiceManager) handleInvoiceAccept(ctx context.Context,
266
279
totalInboundWithMargin := totalInbound + allowedMarginMSat + 1
267
280
invoiceValue := lnwire .MilliSatoshi (req .Invoice .ValueMsat )
268
281
269
- log .Debugf ("Accepted HTLC sum: %v, current HTLC amount: %v, allowed " +
282
+ iLog .Debugf ("accepted HTLC sum: %v, current HTLC amount: %v, allowed " +
270
283
"margin: %v (total %v), invoice value %v" , acceptedHtlcSum ,
271
284
resp .AmtPaid , allowedMarginMSat , totalInboundWithMargin ,
272
285
invoiceValue )
0 commit comments