beignet 0.7.4 → 0.7.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.
@@ -6607,8 +6607,11 @@ class LightningNode extends events_1.EventEmitter {
6607
6607
  });
6608
6608
  }
6609
6609
  }
6610
- if (state.state === types_1.ChannelState.AWAITING_REESTABLISH) {
6611
- const reestablishKey = `reestablish:${channelId.toString('hex')}`;
6610
+ const reestablishKey = `reestablish:${channelId.toString('hex')}`;
6611
+ if (state.state !== types_1.ChannelState.AWAITING_REESTABLISH) {
6612
+ this._stuckChannelTracker.delete(reestablishKey);
6613
+ }
6614
+ else {
6612
6615
  if (!this._stuckChannelTracker.has(reestablishKey)) {
6613
6616
  this._stuckChannelTracker.set(reestablishKey, blockHeight);
6614
6617
  }
@@ -6633,8 +6636,11 @@ class LightningNode extends events_1.EventEmitter {
6633
6636
  }
6634
6637
  }
6635
6638
  }
6636
- if (state.state === types_1.ChannelState.ERRORED && state.fundingTxid) {
6637
- const erroredKey = `errored:${channelId.toString('hex')}`;
6639
+ const erroredKey = `errored:${channelId.toString('hex')}`;
6640
+ if (state.state !== types_1.ChannelState.ERRORED) {
6641
+ this._stuckChannelTracker.delete(erroredKey);
6642
+ }
6643
+ else if (state.fundingTxid) {
6638
6644
  if (!this._stuckChannelTracker.has(erroredKey)) {
6639
6645
  this._stuckChannelTracker.set(erroredKey, blockHeight);
6640
6646
  }
@@ -6656,9 +6662,12 @@ class LightningNode extends events_1.EventEmitter {
6656
6662
  }
6657
6663
  }
6658
6664
  }
6659
- if (effectiveState === types_1.ChannelState.SHUTTING_DOWN ||
6660
- effectiveState === types_1.ChannelState.NEGOTIATING_CLOSING) {
6661
- const shutdownKey = `stuck:${channelId.toString('hex')}`;
6665
+ const shutdownKey = `stuck:${channelId.toString('hex')}`;
6666
+ if (effectiveState !== types_1.ChannelState.SHUTTING_DOWN &&
6667
+ effectiveState !== types_1.ChannelState.NEGOTIATING_CLOSING) {
6668
+ this._stuckChannelTracker.delete(shutdownKey);
6669
+ }
6670
+ else {
6662
6671
  if (!this._stuckChannelTracker.has(shutdownKey)) {
6663
6672
  this._stuckChannelTracker.set(shutdownKey, blockHeight);
6664
6673
  }