mirror of
https://github.com/Ride-The-Lightning/RTL.git
synced 2025-02-22 22:25:43 +01:00
Fix #199 Clicking on restore channel crashing RTL
Fix #199 Clicking on restore channel crashing RTL
This commit is contained in:
parent
83296477b1
commit
354c20a178
33 changed files with 144 additions and 140 deletions
1
angular/1.286c4dfbd0213d219ea9.js
Normal file
1
angular/1.286c4dfbd0213d219ea9.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
angular/6.a69bb57ec0d14fbfe3bb.js
Normal file
1
angular/6.a69bb57ec0d14fbfe3bb.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
angular/7.e26ba5da7c5a423716da.js
Normal file
1
angular/7.e26ba5da7c5a423716da.js
Normal file
File diff suppressed because one or more lines are too long
|
@ -6,8 +6,8 @@
|
||||||
<base href="/rtl/">
|
<base href="/rtl/">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<link rel="icon" type="image/x-icon" href="assets/images/favicon.ico">
|
<link rel="icon" type="image/x-icon" href="assets/images/favicon.ico">
|
||||||
<link rel="stylesheet" href="styles.41a6644c686ce68dce93.css"></head>
|
<link rel="stylesheet" href="styles.486014dd6111683683a1.css"></head>
|
||||||
<body>
|
<body>
|
||||||
<rtl-app></rtl-app>
|
<rtl-app></rtl-app>
|
||||||
<script src="runtime.09d101759e64dd89b479.js"></script><script src="polyfills-es5.763f4f23e8aee5ec234d.js" nomodule></script><script src="polyfills.e59b6f9dc696bd89cf7f.js"></script><script src="main.b927a6aedf151d59d63f.js"></script></body>
|
<script src="runtime.195ce5421929c30fb476.js"></script><script src="polyfills-es5.92f4069201c83f4833ef.js" nomodule></script><script src="polyfills.5ddcccdb990eb395f306.js"></script><script src="main.d117828b66dfda0ef358.js"></script></body>
|
||||||
</html>
|
</html>
|
||||||
|
|
File diff suppressed because one or more lines are too long
1
angular/main.d117828b66dfda0ef358.js
Normal file
1
angular/main.d117828b66dfda0ef358.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
angular/polyfills-es5.92f4069201c83f4833ef.js
Normal file
1
angular/polyfills-es5.92f4069201c83f4833ef.js
Normal file
File diff suppressed because one or more lines are too long
1
angular/polyfills.5ddcccdb990eb395f306.js
Normal file
1
angular/polyfills.5ddcccdb990eb395f306.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
||||||
!function(e){function r(r){for(var n,a,i=r[0],c=r[1],f=r[2],p=0,s=[];p<i.length;p++)o[a=i[p]]&&s.push(o[a][0]),o[a]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(r);s.length;)s.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++)0!==o[t[i]]&&(n=!1);n&&(u.splice(r--,1),e=a(a.s=t[0]))}return e}var n={},o={0:0},u=[];function a(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise(function(r,n){t=o[e]=[r,n]});r.push(t[2]=n);var u,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+""+({}[e]||e)+"."+{1:"54f1b90d9c910a1bad05",6:"ca63776a6affb4a5a747",7:"3c0e9abc7ee3f152f684"}[e]+".js"}(e);var c=new Error;u=function(r){i.onerror=i.onload=null,clearTimeout(f);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var f=setTimeout(function(){u({type:"timeout",target:i})},12e4);i.onerror=i.onload=u,document.head.appendChild(i)}return Promise.all(r)},a.m=e,a.c=n,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,r){if(1&r&&(e=a(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(a.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)a.d(t,n,(function(r){return e[r]}).bind(null,n));return t},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="",a.oe=function(e){throw console.error(e),e};var i=window.webpackJsonp=window.webpackJsonp||[],c=i.push.bind(i);i.push=r,i=i.slice();for(var f=0;f<i.length;f++)r(i[f]);var l=c;t()}([]);
|
|
1
angular/runtime.195ce5421929c30fb476.js
Normal file
1
angular/runtime.195ce5421929c30fb476.js
Normal file
|
@ -0,0 +1 @@
|
||||||
|
!function(e){function r(r){for(var n,a,i=r[0],c=r[1],f=r[2],p=0,s=[];p<i.length;p++)o[a=i[p]]&&s.push(o[a][0]),o[a]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(r);s.length;)s.shift()();return u.push.apply(u,f||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++)0!==o[t[i]]&&(n=!1);n&&(u.splice(r--,1),e=a(a.s=t[0]))}return e}var n={},o={0:0},u=[];function a(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var u,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+""+({}[e]||e)+"."+{1:"286c4dfbd0213d219ea9",6:"a69bb57ec0d14fbfe3bb",7:"e26ba5da7c5a423716da"}[e]+".js"}(e);var c=new Error;u=function(r){i.onerror=i.onload=null,clearTimeout(f);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,t[1](c)}o[e]=void 0}};var f=setTimeout((function(){u({type:"timeout",target:i})}),12e4);i.onerror=i.onload=u,document.head.appendChild(i)}return Promise.all(r)},a.m=e,a.c=n,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,r){if(1&r&&(e=a(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(a.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)a.d(t,n,(function(r){return e[r]}).bind(null,n));return t},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="",a.oe=function(e){throw console.error(e),e};var i=window.webpackJsonp=window.webpackJsonp||[],c=i.push.bind(i);i.push=r,i=i.slice();for(var f=0;f<i.length;f++)r(i[f]);var l=c;t()}([]);
|
File diff suppressed because one or more lines are too long
46
common.js
46
common.js
|
@ -27,19 +27,21 @@ common.getOptions = () => {
|
||||||
common.setOptions = () => {
|
common.setOptions = () => {
|
||||||
if (undefined !== common.nodes[0].options && undefined !== common.nodes[0].options.headers) { return; }
|
if (undefined !== common.nodes[0].options && undefined !== common.nodes[0].options.headers) { return; }
|
||||||
try {
|
try {
|
||||||
common.nodes.forEach(node => {
|
if (common.nodes && common.nodes.length > 0) {
|
||||||
node.options = {
|
common.nodes.forEach(node => {
|
||||||
url: '',
|
node.options = {
|
||||||
rejectUnauthorized: false,
|
url: '',
|
||||||
json: true,
|
rejectUnauthorized: false,
|
||||||
form: ''
|
json: true,
|
||||||
};
|
form: ''
|
||||||
if (node.ln_implementation && node.ln_implementation.toUpperCase() === 'CLT') {
|
};
|
||||||
node.options.headers = { 'macaroon': Buffer.from(fs.readFileSync(path.join(node.macaroon_path, 'access.macaroon'))).toString("base64") };
|
if (node.ln_implementation && node.ln_implementation.toUpperCase() === 'CLT') {
|
||||||
} else {
|
node.options.headers = { 'macaroon': Buffer.from(fs.readFileSync(path.join(node.macaroon_path, 'access.macaroon'))).toString("base64") };
|
||||||
node.options.headers = { 'Grpc-Metadata-macaroon': fs.readFileSync(path.join(node.macaroon_path, 'admin.macaroon')).toString('hex') };
|
} else {
|
||||||
}
|
node.options.headers = { 'Grpc-Metadata-macaroon': fs.readFileSync(path.join(node.macaroon_path, 'admin.macaroon')).toString('hex') };
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
// Options cannot be set before selected node initializes. Updating selected node's options separatly
|
// Options cannot be set before selected node initializes. Updating selected node's options separatly
|
||||||
common.selectedNode.options = {
|
common.selectedNode.options = {
|
||||||
url: '',
|
url: '',
|
||||||
|
@ -54,14 +56,16 @@ common.setOptions = () => {
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Common Set Options Error:' + JSON.stringify(err));
|
console.error('Common Set Options Error:' + JSON.stringify(err));
|
||||||
common.nodes.forEach(node => {
|
if (common.nodes && common.nodes.length > 0) {
|
||||||
node.options = {
|
common.nodes.forEach(node => {
|
||||||
url: '',
|
node.options = {
|
||||||
rejectUnauthorized: false,
|
url: '',
|
||||||
json: true,
|
rejectUnauthorized: false,
|
||||||
form: ''
|
json: true,
|
||||||
};
|
form: ''
|
||||||
});
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
// Options cannot be set before selected node initializes. Updating selected node's options separatly
|
// Options cannot be set before selected node initializes. Updating selected node's options separatly
|
||||||
common.selectedNode.options = {
|
common.selectedNode.options = {
|
||||||
url: '',
|
url: '',
|
||||||
|
|
125
connect.js
125
connect.js
|
@ -281,70 +281,71 @@ connect.validateMultiNodeConfig = (config) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
common.port = (undefined !== config.port) ? connect.normalizePort(config.port) : 3000;
|
common.port = (undefined !== config.port) ? connect.normalizePort(config.port) : 3000;
|
||||||
|
if (config.nodes && config.nodes.length > 0) {
|
||||||
config.nodes.forEach((node, idx) => {
|
config.nodes.forEach((node, idx) => {
|
||||||
common.nodes[idx] = {};
|
common.nodes[idx] = {};
|
||||||
if(node.Authentication.macaroonPath === '' || undefined === node.Authentication.macaroonPath) {
|
if(node.Authentication.macaroonPath === '' || undefined === node.Authentication.macaroonPath) {
|
||||||
errMsg = 'Please set macaroon path for node index ' + node.index + ' in RTL-Multi-Node-Conf.json!';
|
errMsg = 'Please set macaroon path for node index ' + node.index + ' in RTL-Multi-Node-Conf.json!';
|
||||||
} else {
|
|
||||||
common.nodes[idx].macaroon_path = node.Authentication.macaroonPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(
|
|
||||||
(node.Settings.lndServerUrl === '' || undefined === node.Settings.lndServerUrl)
|
|
||||||
&& (node.Settings.lnServerUrl === '' || undefined === node.Settings.lnServerUrl)
|
|
||||||
) {
|
|
||||||
errMsg = errMsg + '\nPlease set server URL for node index ' + node.index + ' in RTL-Multi-Node-Conf.json!';
|
|
||||||
} else {
|
|
||||||
common.nodes[idx].ln_server_url = node.Settings.lndServerUrl ? node.Settings.lndServerUrl : node.Settings.lnServerUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
common.nodes[idx].index = node.index;
|
|
||||||
common.nodes[idx].ln_node = node.lnNode;
|
|
||||||
common.nodes[idx].ln_implementation = node.lnImplementation;
|
|
||||||
if (undefined !== node.Authentication && undefined !== node.Authentication.lndConfigPath) {
|
|
||||||
common.nodes[idx].config_path = node.Authentication.lndConfigPath;
|
|
||||||
} else if (undefined !== node.Authentication && undefined !== node.Authentication.configPath) {
|
|
||||||
common.nodes[idx].config_path = node.Authentication.configPath;
|
|
||||||
} else {
|
|
||||||
common.nodes[idx].config_path = '';
|
|
||||||
}
|
|
||||||
common.nodes[idx].bitcoind_config_path = (undefined !== node.Settings.bitcoindConfigPath) ? node.Settings.bitcoindConfigPath : '';
|
|
||||||
common.nodes[idx].enable_logging = (undefined !== node.Settings.enableLogging) ? node.Settings.enableLogging : false;
|
|
||||||
common.nodes[idx].channel_backup_path = (undefined !== node.Settings.channelBackupPath) ? node.Settings.channelBackupPath : common.rtl_conf_file_path + common.path_separator + 'backup' + common.path_separator + 'node-' + node.index;
|
|
||||||
try {
|
|
||||||
connect.createDirectory(common.nodes[idx].channel_backup_path);
|
|
||||||
let exists = fs.existsSync(common.nodes[idx].channel_backup_path + common.path_separator + 'channel-all.bak');
|
|
||||||
if (!exists) {
|
|
||||||
try {
|
|
||||||
var createStream = fs.createWriteStream(common.nodes[idx].channel_backup_path + common.path_separator + 'channel-all.bak');
|
|
||||||
createStream.end();
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Something went wrong while creating backup file: \n' + err);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Something went wrong while creating backup file: \n' + err);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (common.nodes[idx].enable_logging) {
|
|
||||||
common.nodes[idx].log_file = common.rtl_conf_file_path + '/logs/RTL-Node-' + node.index + '.log';
|
|
||||||
const log_file = common.nodes[idx].log_file;
|
|
||||||
if (fs.existsSync(log_file)) {
|
|
||||||
fs.writeFile(log_file, '', () => { });
|
|
||||||
} else {
|
} else {
|
||||||
try {
|
common.nodes[idx].macaroon_path = node.Authentication.macaroonPath;
|
||||||
var dirname = path.dirname(log_file);
|
}
|
||||||
connect.createDirectory(dirname);
|
|
||||||
var createStream = fs.createWriteStream(log_file);
|
if(
|
||||||
createStream.end();
|
(node.Settings.lndServerUrl === '' || undefined === node.Settings.lndServerUrl)
|
||||||
}
|
&& (node.Settings.lnServerUrl === '' || undefined === node.Settings.lnServerUrl)
|
||||||
catch (err) {
|
) {
|
||||||
console.error('Something went wrong while creating log file ' + log_file + ': \n' + err);
|
errMsg = errMsg + '\nPlease set server URL for node index ' + node.index + ' in RTL-Multi-Node-Conf.json!';
|
||||||
|
} else {
|
||||||
|
common.nodes[idx].ln_server_url = node.Settings.lndServerUrl ? node.Settings.lndServerUrl : node.Settings.lnServerUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
common.nodes[idx].index = node.index;
|
||||||
|
common.nodes[idx].ln_node = node.lnNode;
|
||||||
|
common.nodes[idx].ln_implementation = node.lnImplementation;
|
||||||
|
if (undefined !== node.Authentication && undefined !== node.Authentication.lndConfigPath) {
|
||||||
|
common.nodes[idx].config_path = node.Authentication.lndConfigPath;
|
||||||
|
} else if (undefined !== node.Authentication && undefined !== node.Authentication.configPath) {
|
||||||
|
common.nodes[idx].config_path = node.Authentication.configPath;
|
||||||
|
} else {
|
||||||
|
common.nodes[idx].config_path = '';
|
||||||
|
}
|
||||||
|
common.nodes[idx].bitcoind_config_path = (undefined !== node.Settings.bitcoindConfigPath) ? node.Settings.bitcoindConfigPath : '';
|
||||||
|
common.nodes[idx].enable_logging = (undefined !== node.Settings.enableLogging) ? node.Settings.enableLogging : false;
|
||||||
|
common.nodes[idx].channel_backup_path = (undefined !== node.Settings.channelBackupPath) ? node.Settings.channelBackupPath : common.rtl_conf_file_path + common.path_separator + 'backup' + common.path_separator + 'node-' + node.index;
|
||||||
|
try {
|
||||||
|
connect.createDirectory(common.nodes[idx].channel_backup_path);
|
||||||
|
let exists = fs.existsSync(common.nodes[idx].channel_backup_path + common.path_separator + 'channel-all.bak');
|
||||||
|
if (!exists) {
|
||||||
|
try {
|
||||||
|
var createStream = fs.createWriteStream(common.nodes[idx].channel_backup_path + common.path_separator + 'channel-all.bak');
|
||||||
|
createStream.end();
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Something went wrong while creating backup file: \n' + err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Something went wrong while creating backup file: \n' + err);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (common.nodes[idx].enable_logging) {
|
||||||
|
common.nodes[idx].log_file = common.rtl_conf_file_path + '/logs/RTL-Node-' + node.index + '.log';
|
||||||
|
const log_file = common.nodes[idx].log_file;
|
||||||
|
if (fs.existsSync(log_file)) {
|
||||||
|
fs.writeFile(log_file, '', () => { });
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
var dirname = path.dirname(log_file);
|
||||||
|
connect.createDirectory(dirname);
|
||||||
|
var createStream = fs.createWriteStream(log_file);
|
||||||
|
createStream.end();
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error('Something went wrong while creating log file ' + log_file + ': \n' + err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
connect.setSSOParams(config);
|
connect.setSSOParams(config);
|
||||||
if (errMsg !== '') { throw new Error(errMsg); }
|
if (errMsg !== '') { throw new Error(errMsg); }
|
||||||
|
@ -426,7 +427,7 @@ connect.refreshCookie = (cookieFile) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
connect.logEnvVariables = () => {
|
connect.logEnvVariables = () => {
|
||||||
if (common.multi_node_setup) {
|
if (common.multi_node_setup && common.nodes && common.nodes.length > 0) {
|
||||||
common.nodes.forEach((node, idx) => {
|
common.nodes.forEach((node, idx) => {
|
||||||
if (!node.enable_logging) { return; }
|
if (!node.enable_logging) { return; }
|
||||||
logger.info({fileName: 'Config Setup Variable', msg: 'DEFAULT_NODE_INDEX: ' + common.selectedNode.index});
|
logger.info({fileName: 'Config Setup Variable', msg: 'DEFAULT_NODE_INDEX: ' + common.selectedNode.index});
|
||||||
|
|
|
@ -58,28 +58,30 @@ exports.getRTLConfig = (req, res, next) => {
|
||||||
const multiNodeConfig = JSON.parse(data);
|
const multiNodeConfig = JSON.parse(data);
|
||||||
const sso = { rtlSSO: common.rtl_sso, logoutRedirectLink: common.logout_redirect_link };
|
const sso = { rtlSSO: common.rtl_sso, logoutRedirectLink: common.logout_redirect_link };
|
||||||
var nodesArr = [];
|
var nodesArr = [];
|
||||||
multiNodeConfig.nodes.forEach((node, i) => {
|
if (multiNodeConfig.nodes && multiNodeConfig.nodes.length > 0) {
|
||||||
const authentication = {};
|
multiNodeConfig.nodes.forEach((node, i) => {
|
||||||
authentication.nodeAuthType = 'CUSTOM';
|
const authentication = {};
|
||||||
if(node.Authentication && node.Authentication.lndConfigPath) {
|
authentication.nodeAuthType = 'CUSTOM';
|
||||||
authentication.configPath = node.Authentication.lndConfigPath;
|
if(node.Authentication && node.Authentication.lndConfigPath) {
|
||||||
} else if(node.Authentication && node.Authentication.configPath) {
|
authentication.configPath = node.Authentication.lndConfigPath;
|
||||||
authentication.configPath = node.Authentication.configPath;
|
} else if(node.Authentication && node.Authentication.configPath) {
|
||||||
} else {
|
authentication.configPath = node.Authentication.configPath;
|
||||||
authentication.configPath = '';
|
} else {
|
||||||
}
|
authentication.configPath = '';
|
||||||
|
}
|
||||||
if(node.Settings.bitcoindConfigPath) {
|
|
||||||
authentication.bitcoindConfigPath = node.Settings.bitcoindConfigPath;
|
if(node.Settings.bitcoindConfigPath) {
|
||||||
}
|
authentication.bitcoindConfigPath = node.Settings.bitcoindConfigPath;
|
||||||
node.Settings.channelBackupPath = (undefined !== node.Settings.channelBackupPath) ? node.Settings.channelBackupPath : common.nodes[i].channel_backup_path;
|
}
|
||||||
nodesArr.push({
|
node.Settings.channelBackupPath = (undefined !== node.Settings.channelBackupPath) ? node.Settings.channelBackupPath : common.nodes[i].channel_backup_path;
|
||||||
index: node.index,
|
nodesArr.push({
|
||||||
lnNode: node.lnNode,
|
index: node.index,
|
||||||
lnImplementation: node.lnImplementation,
|
lnNode: node.lnNode,
|
||||||
settings: node.Settings,
|
lnImplementation: node.lnImplementation,
|
||||||
authentication: authentication})
|
settings: node.Settings,
|
||||||
});
|
authentication: authentication})
|
||||||
|
});
|
||||||
|
}
|
||||||
res.status(200).json({ selectedNodeIndex: common.selectedNode.index, sso: sso, nodes: nodesArr });
|
res.status(200).json({ selectedNodeIndex: common.selectedNode.index, sso: sso, nodes: nodesArr });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -135,7 +135,7 @@ exports.listForwards = (req, res, next) => {
|
||||||
error: (undefined === body) ? 'Error From Server!' : body.error
|
error: (undefined === body) ? 'Error From Server!' : body.error
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (body.length > 0) {
|
if (body && body.length > 0) {
|
||||||
body.forEach(event => {
|
body.forEach(event => {
|
||||||
event.received_time_str = (undefined === event.received_time) ? '' : common.convertTimestampToDate(event.received_time);
|
event.received_time_str = (undefined === event.received_time) ? '' : common.convertTimestampToDate(event.received_time);
|
||||||
event.resolved_time_str = (undefined === event.resolved_time) ? '' : common.convertTimestampToDate(event.resolved_time);
|
event.resolved_time_str = (undefined === event.resolved_time) ? '' : common.convertTimestampToDate(event.resolved_time);
|
||||||
|
|
|
@ -37,7 +37,7 @@ exports.listInvoices = (req, res, next) => {
|
||||||
error: (undefined === body) ? 'Error From Server!' : body.error
|
error: (undefined === body) ? 'Error From Server!' : body.error
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (undefined !== body.invoices) {
|
if (undefined !== body.invoices && body.invoices.length > 0) {
|
||||||
body.invoices.forEach(invoice => {
|
body.invoices.forEach(invoice => {
|
||||||
invoice.paid_at_str = (undefined === invoice.paid_at) ? '' : common.convertTimestampToDate(invoice.paid_at);
|
invoice.paid_at_str = (undefined === invoice.paid_at) ? '' : common.convertTimestampToDate(invoice.paid_at);
|
||||||
invoice.expires_at_str = (undefined === invoice.expires_at) ? '' : common.convertTimestampToDate(invoice.expires_at);
|
invoice.expires_at_str = (undefined === invoice.expires_at) ? '' : common.convertTimestampToDate(invoice.expires_at);
|
||||||
|
|
|
@ -14,7 +14,7 @@ exports.listPayments = (req, res, next) => {
|
||||||
error: (undefined === body) ? 'Error From Server!' : body.error
|
error: (undefined === body) ? 'Error From Server!' : body.error
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (undefined !== body && undefined !== body.payments) {
|
if (undefined !== body && undefined !== body.payments && body.payments.length > 0) {
|
||||||
body.payments.forEach(payment => {
|
body.payments.forEach(payment => {
|
||||||
payment.created_at_str = (undefined === payment.created_at) ? '' : common.convertTimestampToDate(payment.created_at);
|
payment.created_at_str = (undefined === payment.created_at) ? '' : common.convertTimestampToDate(payment.created_at);
|
||||||
});
|
});
|
||||||
|
|
|
@ -54,7 +54,7 @@ exports.getChannels = (req, res, next) => {
|
||||||
} else {
|
} else {
|
||||||
body.btc_total_limbo_balance = common.convertToBTC(body.total_limbo_balance);
|
body.btc_total_limbo_balance = common.convertToBTC(body.total_limbo_balance);
|
||||||
}
|
}
|
||||||
if (req.params.channelType === 'closed') {
|
if (req.params.channelType === 'closed' && body.channels && body.channels.length > 0) {
|
||||||
body.channels.forEach(channel => {
|
body.channels.forEach(channel => {
|
||||||
channel.close_type = (undefined === channel.close_type) ? 'COOPERATIVE_CLOSE' : channel.close_type;
|
channel.close_type = (undefined === channel.close_type) ? 'COOPERATIVE_CLOSE' : channel.close_type;
|
||||||
});
|
});
|
||||||
|
|
|
@ -10,15 +10,17 @@ function getFilesList(callback) {
|
||||||
let response = {all_restore_exists: false, files: []};
|
let response = {all_restore_exists: false, files: []};
|
||||||
fs.readdir(common.selectedNode.channel_backup_path + common.path_separator + 'restore', function (err, files) {
|
fs.readdir(common.selectedNode.channel_backup_path + common.path_separator + 'restore', function (err, files) {
|
||||||
if (err && err.code !== 'ENOENT' && err.errno !== -4058) { response = { message: 'Channels Restore List Failed!', error: err } }
|
if (err && err.code !== 'ENOENT' && err.errno !== -4058) { response = { message: 'Channels Restore List Failed!', error: err } }
|
||||||
files.forEach(file => {
|
if(undefined !== files && files.length > 0) {
|
||||||
if (!file.includes('.restored')) {
|
files.forEach(file => {
|
||||||
if (file === 'channel-all.bak') {
|
if (!file.includes('.restored')) {
|
||||||
all_restore_exists = true;
|
if (file === 'channel-all.bak') {
|
||||||
} else {
|
all_restore_exists = true;
|
||||||
files_list.push({channel_point: file.substring(8, file.length - 4).replace('-', ':')});
|
} else {
|
||||||
|
files_list.push({channel_point: file.substring(8, file.length - 4).replace('-', ':')});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
response = {all_restore_exists: all_restore_exists, files: files_list};
|
response = {all_restore_exists: all_restore_exists, files: files_list};
|
||||||
callback(response);
|
callback(response);
|
||||||
});
|
});
|
||||||
|
|
|
@ -128,7 +128,7 @@ exports.getQueryRoutes = (req, res, next) => {
|
||||||
error: (undefined === body) ? 'Error From Server!' : body.error
|
error: (undefined === body) ? 'Error From Server!' : body.error
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (undefined !== body.routes) {
|
if (undefined !== body.routes && body.routes.length > 0) {
|
||||||
body.routes.forEach(route => {
|
body.routes.forEach(route => {
|
||||||
if (undefined !== route.hops) {
|
if (undefined !== route.hops) {
|
||||||
Promise.all(
|
Promise.all(
|
||||||
|
|
|
@ -38,7 +38,7 @@ exports.listInvoices = (req, res, next) => {
|
||||||
error: (undefined === body || search_idx > -1) ? 'Error From Server!' : body.error
|
error: (undefined === body || search_idx > -1) ? 'Error From Server!' : body.error
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (undefined !== body.invoices) {
|
if (undefined !== body.invoices && body.invoices.length > 0) {
|
||||||
body.invoices.forEach(invoice => {
|
body.invoices.forEach(invoice => {
|
||||||
invoice.creation_date_str = (undefined === invoice.creation_date) ? '' : common.convertTimestampToDate(invoice.creation_date);
|
invoice.creation_date_str = (undefined === invoice.creation_date) ? '' : common.convertTimestampToDate(invoice.creation_date);
|
||||||
invoice.settle_date_str = (undefined === invoice.settle_date) ? '' : common.convertTimestampToDate(invoice.settle_date);
|
invoice.settle_date_str = (undefined === invoice.settle_date) ? '' : common.convertTimestampToDate(invoice.settle_date);
|
||||||
|
|
|
@ -16,7 +16,7 @@ exports.getPayments = (req, res, next) => {
|
||||||
error: (undefined === body || search_idx > -1) ? 'Error From Server!' : body.error
|
error: (undefined === body || search_idx > -1) ? 'Error From Server!' : body.error
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (undefined !== body.payments) {
|
if (undefined !== body.payments && body.payments.length > 0) {
|
||||||
body.payments.forEach(payment => {
|
body.payments.forEach(payment => {
|
||||||
payment.creation_date_str = (undefined === payment.creation_date) ? '' : common.convertTimestampToDate(payment.creation_date);
|
payment.creation_date_str = (undefined === payment.creation_date) ? '' : common.convertTimestampToDate(payment.creation_date);
|
||||||
});
|
});
|
||||||
|
|
|
@ -30,7 +30,7 @@ exports.forwardingHistory = (req, res, next) => {
|
||||||
error: (undefined === body) ? 'Error From Server!' : body.error
|
error: (undefined === body) ? 'Error From Server!' : body.error
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (undefined !== body.forwarding_events) {
|
if (undefined !== body.forwarding_events && body.forwarding_events.length > 0) {
|
||||||
body.forwarding_events.forEach(event => {
|
body.forwarding_events.forEach(event => {
|
||||||
event.timestamp_str = (undefined === event.timestamp) ? '' : common.convertTimestampToDate(event.timestamp);
|
event.timestamp_str = (undefined === event.timestamp) ? '' : common.convertTimestampToDate(event.timestamp);
|
||||||
});
|
});
|
||||||
|
|
|
@ -16,7 +16,7 @@ exports.getTransactions = (req, res, next) => {
|
||||||
error: (undefined === body || search_idx > -1) ? 'Error From Server!' : body.error
|
error: (undefined === body || search_idx > -1) ? 'Error From Server!' : body.error
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (undefined !== body.transactions) {
|
if (undefined !== body.transactions && body.transactions.length > 0) {
|
||||||
body.transactions.forEach(transaction => {
|
body.transactions.forEach(transaction => {
|
||||||
transaction.time_stamp_str = (undefined === transaction.time_stamp) ? '' : common.convertTimestampToDate(transaction.time_stamp);
|
transaction.time_stamp_str = (undefined === transaction.time_stamp) ? '' : common.convertTimestampToDate(transaction.time_stamp);
|
||||||
});
|
});
|
||||||
|
|
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "rtl",
|
"name": "rtl",
|
||||||
"version": "0.5.4-beta",
|
"version": "0.5.5-beta",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "rtl",
|
"name": "rtl",
|
||||||
"version": "0.5.4-beta",
|
"version": "0.5.5-beta",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
|
|
|
@ -40,11 +40,6 @@ export class ChannelRestoreComponent implements OnInit {
|
||||||
.pipe(takeUntil(this.unSubs[0]))
|
.pipe(takeUntil(this.unSubs[0]))
|
||||||
.subscribe((rtlStore) => {
|
.subscribe((rtlStore) => {
|
||||||
this.selNode = rtlStore.nodeSettings;
|
this.selNode = rtlStore.nodeSettings;
|
||||||
// rtlStore.effectErrorsLnd.forEach(effectsErr => {
|
|
||||||
// if (effectsErr.action === 'RestoreChannelsList') {
|
|
||||||
// this.flgLoading[0] = 'error';
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
this.logger.info(rtlStore);
|
this.logger.info(rtlStore);
|
||||||
});
|
});
|
||||||
this.lndEffects.setRestoreChannelList
|
this.lndEffects.setRestoreChannelList
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
export const VERSION = '0.5.4-beta';
|
export const VERSION = '0.5.5-beta';
|
Loading…
Add table
Reference in a new issue