|
@ -136,9 +136,8 @@ function subscribeInvoices(parseKeysendInvoice) { |
|
|
exports.subscribeInvoices = subscribeInvoices; |
|
|
exports.subscribeInvoices = subscribeInvoices; |
|
|
var i = 0; |
|
|
var i = 0; |
|
|
var ctx = 0; |
|
|
var ctx = 0; |
|
|
function reconnectToLND(innerCtx) { |
|
|
function reconnectToLND(innerCtx, callback) { |
|
|
return __awaiter(this, void 0, void 0, function* () { |
|
|
return __awaiter(this, void 0, void 0, function* () { |
|
|
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { |
|
|
|
|
|
ctx = innerCtx; |
|
|
ctx = innerCtx; |
|
|
i++; |
|
|
i++; |
|
|
const now = moment().format('YYYY-MM-DD HH:mm:ss').trim(); |
|
|
const now = moment().format('YYYY-MM-DD HH:mm:ss').trim(); |
|
@ -147,7 +146,8 @@ function reconnectToLND(innerCtx) { |
|
|
yield network.initGrpcSubscriptions(); |
|
|
yield network.initGrpcSubscriptions(); |
|
|
const now = moment().format('YYYY-MM-DD HH:mm:ss').trim(); |
|
|
const now = moment().format('YYYY-MM-DD HH:mm:ss').trim(); |
|
|
console.log(`=> [lnd] connected! ${now}`); |
|
|
console.log(`=> [lnd] connected! ${now}`); |
|
|
resolve(); |
|
|
if (callback) |
|
|
|
|
|
callback(); |
|
|
} |
|
|
} |
|
|
catch (e) { |
|
|
catch (e) { |
|
|
if (e.code === ERR_CODE_UNIMPLEMENTED) { |
|
|
if (e.code === ERR_CODE_UNIMPLEMENTED) { |
|
@ -159,7 +159,6 @@ function reconnectToLND(innerCtx) { |
|
|
} |
|
|
} |
|
|
}), 2000); |
|
|
}), 2000); |
|
|
} |
|
|
} |
|
|
})); |
|
|
|
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
exports.reconnectToLND = reconnectToLND; |
|
|
exports.reconnectToLND = reconnectToLND; |
|
|