File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
modules/abstract-lightning/src/wallet Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -311,7 +311,14 @@ export class LightningWallet implements ILightningWallet {
311311 ) ;
312312
313313 const coinSpecific = transactionRequestSend . transactions ?. [ 0 ] ?. unsignedTx ?. coinSpecific ;
314- const updatedTransfer = await this . wallet . getTransfer ( { id : transfer . id } ) ;
314+ let updatedTransfer : any = undefined ;
315+ try {
316+ updatedTransfer = await this . wallet . getTransfer ( { id : transfer . id } ) ;
317+ } catch ( e ) {
318+ // If transfer is not found which is possible in cases where the payment has definitely failed
319+ // Or even if some unknown error occurs, we will not throw an error here
320+ // We still want to return the txRequestId, txRequestState and paymentStatus.
321+ }
315322
316323 return {
317324 txRequestId : transactionRequestCreate . txRequestId ,
@@ -370,7 +377,14 @@ export class LightningWallet implements ILightningWallet {
370377 reqId
371378 ) ;
372379
373- const updatedTransfer = await this . wallet . getTransfer ( { id : transfer . id } ) ;
380+ let updatedTransfer : any = undefined ;
381+ try {
382+ updatedTransfer = await this . wallet . getTransfer ( { id : transfer . id } ) ;
383+ } catch ( e ) {
384+ // If transfer is not found which is possible in cases where the withdraw has definitely failed
385+ // Or even if some unknown error occurs, we will not throw an error here
386+ // We still want to return the txRequestId and txRequestState.
387+ }
374388
375389 return {
376390 txRequestId : transactionRequestCreate . txRequestId ,
You can’t perform that action at this time.
0 commit comments