bolt07 1.9.3 → 1.9.4

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
- ## 1.9.3
3
+ ## 1.9.4
4
4
 
5
5
  - `hopsFromChannels`, `routeFromChannels`, `routeFromHops`: Add support for
6
6
  inbound discounts
package/package.json CHANGED
@@ -28,5 +28,5 @@
28
28
  "scripts": {
29
29
  "test": "npx nyc@15.1 node --experimental-test-coverage --test"
30
30
  },
31
- "version": "1.9.3"
31
+ "version": "1.9.4"
32
32
  }
@@ -92,6 +92,9 @@ module.exports = ({channels, destination}) => {
92
92
  let cltvDelta = (overridePolicy || policy).cltv_delta || defaultCltvDelta;
93
93
  const payIndex = chans.length - payNodesCount;
94
94
 
95
+ const nextCltvPolicy = ((nextPolicy || {}).policies || [])
96
+ .find(n => n.public_key === peer.public_key);
97
+
95
98
  // The end of a route is where the penultimate node pays the ultimate one.
96
99
  if (i < payIndex) {
97
100
  cltvDelta = peer.cltv_delta;
@@ -102,6 +105,10 @@ module.exports = ({channels, destination}) => {
102
105
  cltvDelta = endPolicies.find(n => n.public_key === payingKey).cltv_delta;
103
106
  }
104
107
 
108
+ if (!!nextCltvPolicy) {
109
+ cltvDelta = nextCltvPolicy.cltv_delta;
110
+ }
111
+
105
112
  return {
106
113
  base_fee_mtokens: (overridePolicy || policy).base_fee_mtokens,
107
114
  channel: channel.id,