Browse Source

lg

dependabot/npm_and_yarn/ini-1.3.7
Evan Feenstra 4 years ago
parent
commit
b7f4a7a1b8
  1. 6
      dist/src/grpc/index.js
  2. 2
      dist/src/grpc/index.js.map
  3. 6
      src/grpc/index.ts

6
dist/src/grpc/index.js

@ -20,6 +20,7 @@ const moment = require("moment");
const constants_1 = require("../constants");
const ERR_CODE_UNAVAILABLE = 14;
const ERR_CODE_STREAM_REMOVED = 2;
const ERR_CODE_UNIMPLEMENTED = 12; // locked
function subscribeInvoices(parseKeysendInvoice) {
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
const lightning = yield lightning_1.loadLightning();
@ -148,7 +149,10 @@ function reconnectToLND(innerCtx) {
resolve();
}
catch (e) {
console.log("COULD NOT RECONNECT", e, e.message, e.code);
console.log(`=> ${now} [lnd] error connecting ${e.message}`);
if (e.code === ERR_CODE_UNIMPLEMENTED) {
console.log("UNLOCK EHRE!!!!!");
}
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
if (ctx === innerCtx) { // if another retry fires, then this will not run
yield reconnectToLND(innerCtx);

2
dist/src/grpc/index.js.map

File diff suppressed because one or more lines are too long

6
src/grpc/index.ts

@ -10,6 +10,7 @@ import constants from '../constants'
const ERR_CODE_UNAVAILABLE = 14
const ERR_CODE_STREAM_REMOVED = 2
const ERR_CODE_UNIMPLEMENTED = 12 // locked
export function subscribeInvoices(parseKeysendInvoice) {
return new Promise(async(resolve,reject)=>{
@ -141,7 +142,10 @@ export async function reconnectToLND(innerCtx:number) {
console.log(`=> [lnd] connected! ${now}`)
resolve()
} catch(e) {
console.log("COULD NOT RECONNECT",e,e.message,e.code)
console.log(`=> ${now} [lnd] error connecting ${e.message}`)
if(e.code===ERR_CODE_UNIMPLEMENTED) {
console.log("UNLOCK EHRE!!!!!")
}
setTimeout(async()=>{ // retry each 2 secs
if(ctx===innerCtx) { // if another retry fires, then this will not run
await reconnectToLND(innerCtx)

Loading…
Cancel
Save