lightning 4.14.0 → 4.14.1

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,6 +1,6 @@
1
1
  # Versions
2
2
 
3
- ## 4.14.0
3
+ ## 4.14.1
4
4
 
5
5
  - `getPayment`, `subscribeToPastPayment`: Add `pending` for pending payment details
6
6
 
@@ -3,6 +3,8 @@ const {failureFromPayment} = require('./../../lnd_responses');
3
3
  const {pendingFromPayment} = require('./../../lnd_responses');
4
4
  const {states} = require('./payment_states');
5
5
 
6
+ const {isArray} = Array;
7
+
6
8
  /** Emit payment from payment event
7
9
 
8
10
  {
@@ -22,6 +24,13 @@ module.exports = ({data, emitter}) => {
22
24
  return emitter.emit('failed', failureFromPayment(data));
23
25
 
24
26
  case states.paying:
27
+ const hasHtlcs = !!data && isArray(data.htlcs) && !!data.htlcs.length;
28
+
29
+ // Exit early when no HTLCs are attached
30
+ if (!hasHtlcs) {
31
+ return;
32
+ }
33
+
25
34
  return emitter.emit('paying', pendingFromPayment(data));
26
35
 
27
36
  default:
package/package.json CHANGED
@@ -56,5 +56,5 @@
56
56
  "directory": "test/typescript"
57
57
  },
58
58
  "types": "index.d.ts",
59
- "version": "4.14.0"
59
+ "version": "4.14.1"
60
60
  }