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 +4 -0
- package/liquidity/find_max_payable.js +41 -0
- package/package.json +7 -7
- package/test/liquidity/test_get_synthetic_out_ignores.js +1 -0
- package/test/liquidity/test_subscribe_to_find_path.js +3 -0
- package/test/liquidity/test_subscribe_to_multi_path_probe.js +1 -0
- package/test/payments/test_subscribe_to_multi_path_pay.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -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.
|
|
11
|
-
"asyncjs-util": "1.2.
|
|
12
|
-
"bolt07": "1.8.
|
|
13
|
-
"ln-service": "
|
|
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.
|
|
17
|
+
"@alexbosworth/tap": "15.0.12"
|
|
18
18
|
},
|
|
19
19
|
"engines": {
|
|
20
|
-
"node": ">=
|
|
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": "
|
|
37
|
+
"version": "3.0.1"
|
|
38
38
|
}
|
|
@@ -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',
|