lightning 6.2.3 → 6.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Versions
2
2
 
3
+ ## 6.2.5
4
+
5
+ - Fix errors with LND API changes to HTLC events
6
+
7
+ ## 6.2.4
8
+
9
+ - `getWalletInfo`: Add support for LND 0.15.3
10
+
3
11
  ## 6.2.3
4
12
 
5
13
  - `getWalletInfo`: Add support for LND 0.14.4
@@ -618,6 +618,8 @@ message HtlcEvent {
618
618
  ForwardFailEvent forward_fail_event = 8;
619
619
  SettleEvent settle_event = 9;
620
620
  LinkFailEvent link_fail_event = 10;
621
+ SubscribedEvent subscribed_event = 11;
622
+ FinalHtlcEvent final_htlc_event = 12;
621
623
  }
622
624
  }
623
625
 
@@ -648,6 +650,14 @@ message SettleEvent {
648
650
  bytes preimage = 1;
649
651
  }
650
652
 
653
+ message FinalHtlcEvent {
654
+ bool settled = 1;
655
+ bool offchain = 2;
656
+ }
657
+
658
+ message SubscribedEvent {
659
+ }
660
+
651
661
  message LinkFailEvent {
652
662
  // Info contains details about the htlc that we failed.
653
663
  HtlcInfo info = 1;
@@ -792,6 +802,10 @@ message ForwardHtlcInterceptRequest {
792
802
 
793
803
  // The onion blob for the next hop
794
804
  bytes onion_blob = 9;
805
+
806
+ // The block height at which this htlc will be auto-failed to prevent the
807
+ // channel from force-closing.
808
+ int32 auto_fail_height = 10;
795
809
  }
796
810
 
797
811
  /**
@@ -33,6 +33,7 @@
33
33
  "86d3dec7b939b21bb10f2cd1ff56970c392a1c69": "0.13.2-beta",
34
34
  "86114c575c2dff9dff1e1bb4df961c64aea9fc1c": "0.10.4-beta",
35
35
  "aff2ed3a6a118d664049835c325a5b69e977172f": "0.15.2-beta",
36
+ "b4e7131bdb47531ad2f00ce345ddcdb58935bba5": "0.15.3-beta",
36
37
  "bd0c46b4fcb027af1915bd67a3da70e8ca5c6efe": "0.14.3-beta",
37
38
  "d176d2d65fc06e6631c4dc9478592be8545a21de": "0.12.0-beta",
38
39
  "d233f61383f2f950aa06f5b09da5b0e78e784fae": "0.12.1-beta",
@@ -3,6 +3,7 @@ const {returnResult} = require('asyncjs-util');
3
3
 
4
4
  const {isLnd} = require('./../../lnd_requests');
5
5
 
6
+ const errorMessageNotFound = 'tower not found';
6
7
  const hexAsBuffer = hex => Buffer.from(hex, 'hex');
7
8
  const method = 'removeTower';
8
9
  const type = 'tower_client';
@@ -47,6 +48,11 @@ module.exports = (args, cbk) => {
47
48
  return cbk([501, 'ExpectedLndWithWtclientrpcTagToDisconnect']);
48
49
  }
49
50
 
51
+ // Exit early when the tower is already not present
52
+ if (!!err && err.details === errorMessageNotFound) {
53
+ return cbk();
54
+ }
55
+
50
56
  if (!!err) {
51
57
  return cbk([503, 'UnexpectedErrDisconnectingWatchtower', {err}]);
52
58
  }
@@ -71,6 +71,15 @@ module.exports = ({lnd}) => {
71
71
  const sub = lnd[type][method]({});
72
72
 
73
73
  sub.on('data', data => {
74
+ // Exit early on subscribed events
75
+ if (!!data && !!data.subscribed_event) {
76
+ return;
77
+ }
78
+
79
+ if (!!data && !!data.final_htlc_event) {
80
+ return;
81
+ }
82
+
74
83
  try {
75
84
  emitter.emit(event, forwardFromHtlcEvent(data));
76
85
  } catch (err) {
@@ -81,6 +81,15 @@ module.exports = ({lnd}) => {
81
81
  const emitErr = emitSubscriptionError({emitter, subscription: sub});
82
82
 
83
83
  sub.on('data', data => {
84
+ // Exit early on subscribed events
85
+ if (!!data && !!data.subscribed_event) {
86
+ return;
87
+ }
88
+
89
+ if (!!data && !!data.final_htlc_event) {
90
+ return;
91
+ }
92
+
84
93
  try {
85
94
  const htlc = forwardFromHtlcEvent(data);
86
95
 
package/package.json CHANGED
@@ -7,10 +7,10 @@
7
7
  "url": "https://github.com/alexbosworth/lightning/issues"
8
8
  },
9
9
  "dependencies": {
10
- "@grpc/grpc-js": "1.7.1",
10
+ "@grpc/grpc-js": "1.7.3",
11
11
  "@grpc/proto-loader": "0.7.3",
12
12
  "@types/express": "4.17.14",
13
- "@types/node": "18.8.4",
13
+ "@types/node": "18.11.7",
14
14
  "@types/request": "2.48.8",
15
15
  "@types/ws": "8.5.3",
16
16
  "async": "3.2.4",
@@ -19,7 +19,7 @@
19
19
  "bn.js": "5.2.1",
20
20
  "body-parser": "1.20.1",
21
21
  "bolt07": "1.8.2",
22
- "bolt09": "0.2.3",
22
+ "bolt09": "0.2.4",
23
23
  "cbor": "8.1.0",
24
24
  "ecpair": "2.1.0",
25
25
  "express": "4.18.2",
@@ -34,7 +34,7 @@
34
34
  "@alexbosworth/tap": "15.0.11",
35
35
  "tsd": "0.24.1",
36
36
  "typescript": "4.8.4",
37
- "ws": "8.9.0"
37
+ "ws": "8.10.0"
38
38
  },
39
39
  "engines": {
40
40
  "node": ">=14"
@@ -59,5 +59,5 @@
59
59
  "directory": "test/typescript"
60
60
  },
61
61
  "types": "index.d.ts",
62
- "version": "6.2.3"
62
+ "version": "6.2.5"
63
63
  }