Update nwcjs.js

This commit is contained in:
supertestnet authored and GitHub committed 2024-05-29 05:10:39 -05:00
1 parent 9c0c1bae5f
commit cb40974558
1 file changed
+2 -1
+2 -1
View File
@@ -175,7 +175,8 @@ var nwcjs = {
},
didPaymentSucceed: async ( nwc_obj, invoice, seconds_of_delay_tolerable = 3 ) => {
var invoice_info = await nwcjs.checkInvoice( nwc_obj, invoice, seconds_of_delay_tolerable );
if ( invoice_info && !( "error" in invoice_info ) ) return invoice_info[ "result" ][ "preimage" ];
if ( invoice_info && !( "error" in invoice_info ) && "result" in invoice_info && "preimage" in invoice_info[ "result" ] )
return invoice_info[ "result" ][ "preimage" ];
return false;
},
tryToPayInvoice: async ( nwc_obj, invoice, amnt ) => {