probing 2.0.6 → 3.0.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,5 +1,9 @@
1
1
  # Versions
2
2
 
3
+ ## Version 3.0.1
4
+
5
+ - Node.js 14 or higher is now required
6
+
3
7
  ## Version 2.0.6
4
8
 
5
9
  Node.js 12.20.0 or higher is now required
@@ -172,6 +172,47 @@ module.exports = (args, cbk) => {
172
172
  return cbk(null, {route, maximum: res.maximum});
173
173
  });
174
174
  }],
175
+
176
+ // Get channels again to confirm policies are consistent
177
+ refetchChannels: ['findMax', ({}, cbk) => {
178
+ const {channels} = channelsFromHints({request, routes});
179
+
180
+ return getPoliciesForChannels({channels, hops, lnd}, cbk);
181
+ }],
182
+
183
+ // Check that policies remained consistent
184
+ checkPolicies: [
185
+ 'getChannels',
186
+ 'refetchChannels',
187
+ ({getChannels, refetchChannels}, cbk) =>
188
+ {
189
+ const {channels} = getChannels;
190
+
191
+ // Find a channel where the fee increased from the start
192
+ const feeIncrease = refetchChannels.channels.find(channel => {
193
+ const [currentA, currentB] = channel.policies;
194
+ const {policies} = channels.find(n => n.id === channel.id);
195
+
196
+ const [initialA, initialB] = policies;
197
+
198
+ if (currentA.fee_rate > initialA.fee_rate) {
199
+ return true;
200
+ }
201
+
202
+ if (currentB.fee_rate > initialB.fee_rate) {
203
+ return true;
204
+ }
205
+
206
+ return false;
207
+ });
208
+
209
+ // Exit with error when there was a fee increase on a channel
210
+ if (!!feeIncrease) {
211
+ return cbk([503, 'FeeIncreasedOnChannel', {id: feeIncrease.id}]);
212
+ }
213
+
214
+ return cbk();
215
+ }],
175
216
  },
176
217
  returnResult({reject, resolve, of: 'findMax'}, cbk));
177
218
  });
package/package.json CHANGED
@@ -7,17 +7,17 @@
7
7
  "url": "https://github.com/alexbosworth/probing/issues"
8
8
  },
9
9
  "dependencies": {
10
- "async": "3.2.3",
11
- "asyncjs-util": "1.2.9",
12
- "bolt07": "1.8.2",
13
- "ln-service": "53.17.1"
10
+ "async": "3.2.4",
11
+ "asyncjs-util": "1.2.11",
12
+ "bolt07": "1.8.3",
13
+ "ln-service": "54.9.0"
14
14
  },
15
15
  "description": "Lightning Network probing utilities",
16
16
  "devDependencies": {
17
- "@alexbosworth/tap": "15.0.11"
17
+ "@alexbosworth/tap": "15.0.12"
18
18
  },
19
19
  "engines": {
20
- "node": ">=12.20"
20
+ "node": ">=14"
21
21
  },
22
22
  "keywords": [
23
23
  "lightning",
@@ -34,5 +34,5 @@
34
34
  "scripts": {
35
35
  "test": "tap --branches=1 --functions=1 --lines=1 --statements=1 test/graph/*.js test/liquidity/*.js test/payments/*.js test/routing/*.js"
36
36
  },
37
- "version": "2.0.6"
37
+ "version": "3.0.1"
38
38
  }
@@ -13,6 +13,7 @@ const makeArgs = overrides => {
13
13
  listChannels: ({}, cbk) => cbk(null, {
14
14
  channels: [{
15
15
  active: true,
16
+ alias_scids: [],
16
17
  capacity: 1,
17
18
  chan_id: '1',
18
19
  channel_point: '00:1',
@@ -44,6 +44,7 @@ const makeLnd = overrides => {
44
44
  listChannels: ({}, cbk) => cbk(null, {
45
45
  channels: [{
46
46
  active: true,
47
+ alias_scids: [],
47
48
  capacity: 1,
48
49
  chan_id: '1',
49
50
  channel_point: '00:1',
@@ -197,6 +198,7 @@ const tests = [
197
198
  listChannels: ({}, cbk) => cbk(null, {
198
199
  channels: [{
199
200
  active: true,
201
+ alias_scids: [],
200
202
  capacity: 1,
201
203
  chan_id: '1',
202
204
  channel_point: '00:1',
@@ -311,6 +313,7 @@ const tests = [
311
313
  listChannels: ({}, cbk) => cbk(null, {
312
314
  channels: [{
313
315
  active: true,
316
+ alias_scids: [],
314
317
  capacity: 1,
315
318
  chan_id: '1',
316
319
  channel_point: '00:1',
@@ -158,6 +158,7 @@ const tests = [
158
158
  listChannels: ({}, cbk) => cbk(null, {
159
159
  channels: [{
160
160
  active: true,
161
+ alias_scids: [],
161
162
  capacity: 1,
162
163
  chan_id: '1',
163
164
  channel_point: '00:1',
@@ -20,6 +20,7 @@ const makeLnd = overrides => {
20
20
  listChannels: ({}, cbk) => cbk(null, {
21
21
  channels: [{
22
22
  active: true,
23
+ alias_scids: [],
23
24
  capacity: 1,
24
25
  chan_id: '1',
25
26
  channel_point: '00:1',