diff --git a/dist/src/grpc/index.js b/dist/src/grpc/index.js index 0436bc9..539bb72 100644 --- a/dist/src/grpc/index.js +++ b/dist/src/grpc/index.js @@ -18,6 +18,7 @@ const lightning_1 = require("../utils/lightning"); const network = require("../network"); const moment = require("moment"); const constants_1 = require("../constants"); +const unlock_1 = require("../utils/unlock"); const ERR_CODE_UNAVAILABLE = 14; const ERR_CODE_STREAM_REMOVED = 2; const ERR_CODE_UNIMPLEMENTED = 12; // locked @@ -149,9 +150,8 @@ function reconnectToLND(innerCtx) { resolve(); } catch (e) { - console.log(`=> ${now} [lnd] error connecting ${e.message}`); if (e.code === ERR_CODE_UNIMPLEMENTED) { - console.log("UNLOCK EHRE!!!!!"); + yield unlock_1.tryToUnlockLND(); } setTimeout(() => __awaiter(this, void 0, void 0, function* () { if (ctx === innerCtx) { // if another retry fires, then this will not run diff --git a/dist/src/grpc/index.js.map b/dist/src/grpc/index.js.map index 14049c9..82691d8 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;AACjC,MAAM,sBAAsB,GAAG,EAAE,CAAA,CAAC,SAAS;AAE3C,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,EAAE,CAAC,MAAM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,CAAA;IACH,CAAC;CAAA;AAtBD,wCAsBC"} \ No newline at end of file diff --git a/dist/src/utils/unlock.js b/dist/src/utils/unlock.js index 1d9280d..e09dc66 100644 --- a/dist/src/utils/unlock.js +++ b/dist/src/utils/unlock.js @@ -18,12 +18,14 @@ const config = require(path.join(__dirname, '../../config/app.json'))[env]; // /relay/.lnd/.lndpwd function tryToUnlockLND() { return __awaiter(this, void 0, void 0, function* () { - const p = config.lnd_pwd; + const p = config.lnd_pwd_path; if (!p) return; - var pwd = getFirstLine(config.lnd_pwd); + console.log('==>', p); + var pwd = getFirstLine(config.lnd_pwd_path); if (!pwd) return; + console.log('==>', pwd); yield lightning_1.unlockWallet(pwd); }); } diff --git a/dist/src/utils/unlock.js.map b/dist/src/utils/unlock.js.map index 520d844..4a7a2e9 100644 --- a/dist/src/utils/unlock.js.map +++ b/dist/src/utils/unlock.js.map @@ -1 +1 @@ -{"version":3,"file":"unlock.js","sourceRoot":"","sources":["../../../src/utils/unlock.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAC5B,2CAA0C;AAC1C,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AACxB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAErC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE1E,sBAAsB;AAEtB,SAAsB,cAAc;;QAChC,MAAM,CAAC,GAAG,MAAM,CAAC,OAAO,CAAA;QACxB,IAAI,CAAC,CAAC;YAAE,OAAM;QAEd,IAAI,GAAG,GAAG,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACvC,IAAG,CAAC,GAAG;YAAE,OAAM;QAEf,MAAM,wBAAY,CAAC,GAAG,CAAC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AAC,CAAC;QAC5C,IAAG,CAAC,GAAG;YAAE,OAAM;QAEf,OAAO,CAAC,GAAG,CAAC,KAAK,EAAC,GAAG,CAAC,CAAA;QAEtB,MAAM,wBAAY,CAAC,GAAG,CAAC,CAAA;IAC3B,CAAC;CAAA;AAZD,wCAYC;AAED,SAAe,YAAY,CAAC,UAAU;;QAClC,MAAM,QAAQ,GAAG,EAAE,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACjD,MAAM,MAAM,GAAG,QAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC7D,MAAM,IAAI,GAAG,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YACvC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;gBACvB,MAAM,CAAC,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QACH,QAAQ,CAAC,KAAK,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IAChB,CAAC;CAAA"} \ No newline at end of file diff --git a/src/grpc/index.ts b/src/grpc/index.ts index 4803bbc..2d5d482 100644 --- a/src/grpc/index.ts +++ b/src/grpc/index.ts @@ -7,6 +7,7 @@ import {loadLightning} from '../utils/lightning' import * as network from '../network' import * as moment from 'moment' import constants from '../constants' +import {tryToUnlockLND} from '../utils/unlock' const ERR_CODE_UNAVAILABLE = 14 const ERR_CODE_STREAM_REMOVED = 2 @@ -142,9 +143,8 @@ export async function reconnectToLND(innerCtx:number) { console.log(`=> [lnd] connected! ${now}`) resolve() } catch(e) { - console.log(`=> ${now} [lnd] error connecting ${e.message}`) if(e.code===ERR_CODE_UNIMPLEMENTED) { - console.log("UNLOCK EHRE!!!!!") + await tryToUnlockLND() } setTimeout(async()=>{ // retry each 2 secs if(ctx===innerCtx) { // if another retry fires, then this will not run diff --git a/src/utils/unlock.ts b/src/utils/unlock.ts index b9b58c2..88270e7 100644 --- a/src/utils/unlock.ts +++ b/src/utils/unlock.ts @@ -9,12 +9,16 @@ const config = require(path.join(__dirname, '../../config/app.json'))[env] // /relay/.lnd/.lndpwd export async function tryToUnlockLND() { - const p = config.lnd_pwd + const p = config.lnd_pwd_path if (!p) return - var pwd = getFirstLine(config.lnd_pwd); + console.log('==>',p) + + var pwd = getFirstLine(config.lnd_pwd_path); if(!pwd) return + console.log('==>',pwd) + await unlockWallet(pwd) }