[lightning] fix node features binary conversion

This commit is contained in:
nymkappa 2023-07-08 10:59:43 +02:00
parent 6336c529ed
commit 8fb67a914c
No known key found for this signature in database
GPG Key ID: E155910B16E8BD04

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;