diff --git a/dist/src/grpc/index.js b/dist/src/grpc/index.js index cce7053..0436bc9 100644 --- a/dist/src/grpc/index.js +++ b/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); diff --git a/dist/src/grpc/index.js.map b/dist/src/grpc/index.js.map index d7c70e3..14049c9 100644 --- a/dist/src/grpc/index.js.map +++ b/dist/src/grpc/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/grpc/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,0CAAyC;AACzC,gCAAsD;AACtD,2CAA0C;AAC1C,+CAA8C;AAC9C,kDAAgD;AAChD,sCAAqC;AACrC,iCAAgC;AAChC,4CAAoC;AAEpC,MAAM,oBAAoB,GAAG,EAAE,CAAA;AAC/B,MAAM,uBAAuB,GAAG,CAAC,CAAA;AAEjC,SAAgB,iBAAiB,CAAC,mBAAmB;IACpD,OAAO,IAAI,OAAO,CAAC,CAAM,OAAO,EAAC,MAAM,EAAC,EAAE;QACzC,MAAM,SAAS,GAAG,MAAM,yBAAa,EAAE,CAAA;QAEvC,IAAI,IAAI,GAAG,SAAS,CAAC,iBAAiB,EAAE,CAAA;QACxC,IAAI,CAAC,E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QACF,CAAC,CAAA,CAAC,CAAA;IACH,CAAC;CAAA;AAvBD,wCAuBC"} \ No newline at end of file diff --git a/src/grpc/index.ts b/src/grpc/index.ts index 4234daa..4803bbc 100644 --- a/src/grpc/index.ts +++ b/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)