diff --git a/backend/src/api/explorer/nodes.api.ts b/backend/src/api/explorer/nodes.api.ts index 7d78559c4..22f9ca48a 100644 --- a/backend/src/api/explorer/nodes.api.ts +++ b/backend/src/api/explorer/nodes.api.ts @@ -80,17 +80,20 @@ class NodesApi { // Features node.features = JSON.parse(node.features); - let maxBit = 0; - for (const feature of node.features) { - maxBit = Math.max(maxBit, feature.bit); + node.featuresBits = null; + if (node.features) { + let maxBit = 0; + for (const feature of node.features) { + maxBit = Math.max(maxBit, feature.bit); + } + maxBit = Math.ceil(maxBit / 4) * 4 - 1; + + node.featuresBits = new Array(maxBit + 1).fill(0); + for (const feature of node.features) { + node.featuresBits[feature.bit] = 1; + } + node.featuresBits = bin2hex(node.featuresBits.reverse().join('')); } - maxBit = Math.ceil(maxBit / 4) * 4 - 1; - - node.featuresBits = new Array(maxBit + 1).fill(0); - for (const feature of node.features) { - node.featuresBits[feature.bit] = 1; - } - node.featuresBits = bin2hex(node.featuresBits.reverse().join('')); // Active channels and capacity const activeChannelsStats: any = await this.$getActiveChannelsStats(public_key); diff --git a/frontend/src/app/lightning/node/node.component.html b/frontend/src/app/lightning/node/node.component.html index 0ed1c78c9..47b10184e 100644 --- a/frontend/src/app/lightning/node/node.component.html +++ b/frontend/src/app/lightning/node/node.component.html @@ -102,10 +102,10 @@ - + - +