beignet 0.5.8 → 0.6.0

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.
@@ -741,8 +741,15 @@ class BeignetNode extends events_1.EventEmitter {
741
741
  getSplicingBalanceSats() {
742
742
  let totalMsat = 0n;
743
743
  for (const ch of this.node.listChannels()) {
744
- if (ch.state === types_3.ChannelState.SPLICING) {
745
- totalMsat += ch.pendingSpliceLocalBalanceMsat ?? ch.localBalanceMsat;
744
+ if (ch.payThroughSplice === undefined)
745
+ continue;
746
+ const pending = ch.pendingSpliceLocalBalanceMsat ?? ch.localBalanceMsat;
747
+ if (ch.payThroughSplice) {
748
+ const counted = pending < ch.localBalanceMsat ? pending : ch.localBalanceMsat;
749
+ totalMsat += pending - counted;
750
+ }
751
+ else {
752
+ totalMsat += pending;
746
753
  }
747
754
  }
748
755
  return Number(totalMsat / 1000n);