beignet 0.5.4 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2640,9 +2640,12 @@ class BeignetNode extends events_1.EventEmitter {
2640
2640
  const blockHeight = this.node.getCurrentBlockHeight();
2641
2641
  const electrumConnected = this.wallet?.electrum?.connectedToElectrum ?? false;
2642
2642
  const channels = this.node.listChannels();
2643
- const readyChannels = channels.filter((ch) => ch.state === 'NORMAL');
2643
+ const readyChannels = channels.filter((ch) => ch.state === types_3.ChannelState.NORMAL);
2644
2644
  const peerCount = this.node.listPeers().length;
2645
2645
  const graph = this.node.getGraph();
2646
+ const operating = channels.filter((ch) => ch.state === types_3.ChannelState.NORMAL || ch.state === types_3.ChannelState.SPLICING);
2647
+ const broken = channels.filter((ch) => ch.state === types_3.ChannelState.AWAITING_REESTABLISH ||
2648
+ ch.state === types_3.ChannelState.ERRORED);
2646
2649
  let status = 'ready';
2647
2650
  if (!electrumConnected) {
2648
2651
  status = 'degraded';
@@ -2650,10 +2653,10 @@ class BeignetNode extends events_1.EventEmitter {
2650
2653
  else if (blockHeight === 0) {
2651
2654
  status = 'syncing';
2652
2655
  }
2653
- else if (channels.length > 0 && readyChannels.length === 0) {
2656
+ else if (broken.length > 0 && operating.length === 0) {
2654
2657
  status = 'degraded';
2655
2658
  }
2656
- else if (peerCount === 0 && channels.length > 0) {
2659
+ else if (peerCount === 0 && operating.length > 0) {
2657
2660
  status = 'degraded';
2658
2661
  }
2659
2662
  return {