Fix #199 Clicking on restore channel crashing RTL

Fix #199 Clicking on restore channel crashing RTL
pull/209/head
Shahana Farooqui 5 years ago
parent 83296477b1
commit 354c20a178

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

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

@ -6,8 +6,8 @@
<base href="/rtl/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<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>
<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>

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

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 +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()}([]);

@ -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

@ -27,6 +27,7 @@ common.getOptions = () => {
common.setOptions = () => {
if (undefined !== common.nodes[0].options && undefined !== common.nodes[0].options.headers) { return; }
try {
if (common.nodes && common.nodes.length > 0) {
common.nodes.forEach(node => {
node.options = {
url: '',
@ -40,6 +41,7 @@ common.setOptions = () => {
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
common.selectedNode.options = {
url: '',
@ -54,6 +56,7 @@ common.setOptions = () => {
}
} catch (err) {
console.error('Common Set Options Error:' + JSON.stringify(err));
if (common.nodes && common.nodes.length > 0) {
common.nodes.forEach(node => {
node.options = {
url: '',
@ -62,6 +65,7 @@ common.setOptions = () => {
form: ''
};
});
}
// Options cannot be set before selected node initializes. Updating selected node's options separatly
common.selectedNode.options = {
url: '',

@ -281,7 +281,7 @@ connect.validateMultiNodeConfig = (config) => {
}
common.port = (undefined !== config.port) ? connect.normalizePort(config.port) : 3000;
if (config.nodes && config.nodes.length > 0) {
config.nodes.forEach((node, idx) => {
common.nodes[idx] = {};
if(node.Authentication.macaroonPath === '' || undefined === node.Authentication.macaroonPath) {
@ -345,6 +345,7 @@ connect.validateMultiNodeConfig = (config) => {
}
}
});
}
connect.setSSOParams(config);
if (errMsg !== '') { throw new Error(errMsg); }
@ -426,7 +427,7 @@ connect.refreshCookie = (cookieFile) => {
}
connect.logEnvVariables = () => {
if (common.multi_node_setup) {
if (common.multi_node_setup && common.nodes && common.nodes.length > 0) {
common.nodes.forEach((node, idx) => {
if (!node.enable_logging) { return; }
logger.info({fileName: 'Config Setup Variable', msg: 'DEFAULT_NODE_INDEX: ' + common.selectedNode.index});

@ -58,6 +58,7 @@ exports.getRTLConfig = (req, res, next) => {
const multiNodeConfig = JSON.parse(data);
const sso = { rtlSSO: common.rtl_sso, logoutRedirectLink: common.logout_redirect_link };
var nodesArr = [];
if (multiNodeConfig.nodes && multiNodeConfig.nodes.length > 0) {
multiNodeConfig.nodes.forEach((node, i) => {
const authentication = {};
authentication.nodeAuthType = 'CUSTOM';
@ -80,6 +81,7 @@ exports.getRTLConfig = (req, res, next) => {
settings: node.Settings,
authentication: authentication})
});
}
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
});
} else {
if (body.length > 0) {
if (body && body.length > 0) {
body.forEach(event => {
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);

@ -37,7 +37,7 @@ exports.listInvoices = (req, res, next) => {
error: (undefined === body) ? 'Error From Server!' : body.error
});
} else {
if (undefined !== body.invoices) {
if (undefined !== body.invoices && body.invoices.length > 0) {
body.invoices.forEach(invoice => {
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);

@ -14,7 +14,7 @@ exports.listPayments = (req, res, next) => {
error: (undefined === body) ? 'Error From Server!' : body.error
});
} else {
if (undefined !== body && undefined !== body.payments) {
if (undefined !== body && undefined !== body.payments && body.payments.length > 0) {
body.payments.forEach(payment => {
payment.created_at_str = (undefined === payment.created_at) ? '' : common.convertTimestampToDate(payment.created_at);
});

@ -54,7 +54,7 @@ exports.getChannels = (req, res, next) => {
} else {
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 => {
channel.close_type = (undefined === channel.close_type) ? 'COOPERATIVE_CLOSE' : channel.close_type;
});

@ -10,6 +10,7 @@ function getFilesList(callback) {
let response = {all_restore_exists: false, 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(undefined !== files && files.length > 0) {
files.forEach(file => {
if (!file.includes('.restored')) {
if (file === 'channel-all.bak') {
@ -19,6 +20,7 @@ function getFilesList(callback) {
}
}
});
}
response = {all_restore_exists: all_restore_exists, files: files_list};
callback(response);
});

@ -128,7 +128,7 @@ exports.getQueryRoutes = (req, res, next) => {
error: (undefined === body) ? 'Error From Server!' : body.error
});
}
if (undefined !== body.routes) {
if (undefined !== body.routes && body.routes.length > 0) {
body.routes.forEach(route => {
if (undefined !== route.hops) {
Promise.all(

@ -38,7 +38,7 @@ exports.listInvoices = (req, res, next) => {
error: (undefined === body || search_idx > -1) ? 'Error From Server!' : body.error
});
} else {
if (undefined !== body.invoices) {
if (undefined !== body.invoices && body.invoices.length > 0) {
body.invoices.forEach(invoice => {
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);

@ -16,7 +16,7 @@ exports.getPayments = (req, res, next) => {
error: (undefined === body || search_idx > -1) ? 'Error From Server!' : body.error
});
} else {
if (undefined !== body.payments) {
if (undefined !== body.payments && body.payments.length > 0) {
body.payments.forEach(payment => {
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
});
} else {
if (undefined !== body.forwarding_events) {
if (undefined !== body.forwarding_events && body.forwarding_events.length > 0) {
body.forwarding_events.forEach(event => {
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
});
} else {
if (undefined !== body.transactions) {
if (undefined !== body.transactions && body.transactions.length > 0) {
body.transactions.forEach(transaction => {
transaction.time_stamp_str = (undefined === transaction.time_stamp) ? '' : common.convertTimestampToDate(transaction.time_stamp);
});

2
package-lock.json generated

@ -1,6 +1,6 @@
{
"name": "rtl",
"version": "0.5.4-beta",
"version": "0.5.5-beta",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

@ -1,6 +1,6 @@
{
"name": "rtl",
"version": "0.5.4-beta",
"version": "0.5.5-beta",
"license": "MIT",
"scripts": {
"ng": "ng",

@ -40,11 +40,6 @@ export class ChannelRestoreComponent implements OnInit {
.pipe(takeUntil(this.unSubs[0]))
.subscribe((rtlStore) => {
this.selNode = rtlStore.nodeSettings;
// rtlStore.effectErrorsLnd.forEach(effectsErr => {
// if (effectsErr.action === 'RestoreChannelsList') {
// this.flgLoading[0] = 'error';
// }
// });
this.logger.info(rtlStore);
});
this.lndEffects.setRestoreChannelList

@ -1 +1 @@
export const VERSION = '0.5.4-beta';
export const VERSION = '0.5.5-beta';
Loading…
Cancel
Save