[lightning] fix node features binary conversion

This commit is contained in:
nymkappa committed 2023-07-16 18:17:49 +09:00
1 parent 6336c529ed
commit 8fb67a914c
1 file changed
+2
+2
View File
@@ -84,6 +84,8 @@ class NodesApi {
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;