mirror of
https://github.com/mempool/mempool.git
synced 2025-03-03 17:47:01 +01:00
[lightning] save bit number when converting features from clightning
This commit is contained in:
parent
1f003cc292
commit
32d46ad7ac
3 changed files with 7 additions and 1 deletions
|
@ -56,7 +56,8 @@ class NodesApi {
|
||||||
UNIX_TIMESTAMP(updated_at) AS updated_at, color, sockets as sockets,
|
UNIX_TIMESTAMP(updated_at) AS updated_at, color, sockets as sockets,
|
||||||
as_number, city_id, country_id, subdivision_id, longitude, latitude,
|
as_number, city_id, country_id, subdivision_id, longitude, latitude,
|
||||||
geo_names_iso.names as iso_code, geo_names_as.names as as_organization, geo_names_city.names as city,
|
geo_names_iso.names as iso_code, geo_names_as.names as as_organization, geo_names_city.names as city,
|
||||||
geo_names_country.names as country, geo_names_subdivision.names as subdivision
|
geo_names_country.names as country, geo_names_subdivision.names as subdivision,
|
||||||
|
features
|
||||||
FROM nodes
|
FROM nodes
|
||||||
LEFT JOIN geo_names geo_names_as on geo_names_as.id = as_number
|
LEFT JOIN geo_names geo_names_as on geo_names_as.id = as_number
|
||||||
LEFT JOIN geo_names geo_names_city on geo_names_city.id = city_id
|
LEFT JOIN geo_names geo_names_city on geo_names_city.id = city_id
|
||||||
|
@ -75,6 +76,8 @@ class NodesApi {
|
||||||
node.subdivision = JSON.parse(node.subdivision);
|
node.subdivision = JSON.parse(node.subdivision);
|
||||||
node.city = JSON.parse(node.city);
|
node.city = JSON.parse(node.city);
|
||||||
node.country = JSON.parse(node.country);
|
node.country = JSON.parse(node.country);
|
||||||
|
|
||||||
|
node.features = JSON.parse(node.features);
|
||||||
|
|
||||||
// Active channels and capacity
|
// Active channels and capacity
|
||||||
const activeChannelsStats: any = await this.$getActiveChannelsStats(public_key);
|
const activeChannelsStats: any = await this.$getActiveChannelsStats(public_key);
|
||||||
|
|
|
@ -114,12 +114,14 @@ export function convertNode(clNode: any): ILightningApi.Node {
|
||||||
const feature = FeaturesMap.get(i);
|
const feature = FeaturesMap.get(i);
|
||||||
if (!feature) {
|
if (!feature) {
|
||||||
nodeFeatures.push({
|
nodeFeatures.push({
|
||||||
|
bit: i,
|
||||||
name: 'unknown',
|
name: 'unknown',
|
||||||
is_required: i % 2 === 0,
|
is_required: i % 2 === 0,
|
||||||
is_known: false
|
is_known: false
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
nodeFeatures.push({
|
nodeFeatures.push({
|
||||||
|
bit: i,
|
||||||
name: feature,
|
name: feature,
|
||||||
is_required: i % 2 === 0,
|
is_required: i % 2 === 0,
|
||||||
is_known: true
|
is_known: true
|
||||||
|
|
|
@ -79,6 +79,7 @@ export namespace ILightningApi {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Feature {
|
export interface Feature {
|
||||||
|
bit: number;
|
||||||
name: string;
|
name: string;
|
||||||
is_required: boolean;
|
is_required: boolean;
|
||||||
is_known: boolean;
|
is_known: boolean;
|
||||||
|
|
Loading…
Add table
Reference in a new issue