balanceofsatoshis 25.3.0 → 25.3.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 +1 -1
- package/package.json +1 -1
- package/peers/find_peer_match.js +8 -0
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -103,5 +103,5 @@
|
|
|
103
103
|
"postpublish": "docker buildx build --platform linux/amd64,linux/arm64 -t alexbosworth/balanceofsatoshis -t alexbosworth/balanceofsatoshis:$npm_package_version --push .",
|
|
104
104
|
"test": "node --experimental-test-coverage --test test/arrays/*.js test/balances/*.js test/chain/*.js test/display/*.js test/encryption/*.js test/lnd/*.js test/network/*.js test/nodes/*.js test/offchain/*.js test/peers/*.js test/responses/*.js test/routing/*.js test/services/*.js test/swaps/*.js test/tags/*.js test/telegram/*.js test/wallets/*.js"
|
|
105
105
|
},
|
|
106
|
-
"version": "25.3.
|
|
106
|
+
"version": "25.3.1"
|
|
107
107
|
}
|
package/peers/find_peer_match.js
CHANGED
|
@@ -4,6 +4,7 @@ const {shuffle} = require('./../arrays');
|
|
|
4
4
|
const {isMatchingFilters} = require('./../display');
|
|
5
5
|
|
|
6
6
|
const channelHeight = channel => decodeChanId({channel}).block_height;
|
|
7
|
+
const isFeeFilter = n => /\binbound_(base_fee|fee_rate)\b/i.test(n);
|
|
7
8
|
const {max} = Math;
|
|
8
9
|
const sumOf = arr => arr.reduce((sum, n) => sum + n, Number());
|
|
9
10
|
const tok = n => Number(BigInt(n) / BigInt(1e3));
|
|
@@ -11,6 +12,8 @@ const uniq = arr => Array.from(new Set(arr));
|
|
|
11
12
|
|
|
12
13
|
/** Find a peer that matches filters
|
|
13
14
|
|
|
15
|
+
A peer with no known remote fee policy does not match fee filters.
|
|
16
|
+
|
|
14
17
|
{
|
|
15
18
|
channels: [{
|
|
16
19
|
capacity: <Channel Token Capacity Number>
|
|
@@ -72,6 +75,11 @@ module.exports = ({channels, filters, nodes, policies}) => {
|
|
|
72
75
|
pending_payments: sumOf(pendingPayments),
|
|
73
76
|
};
|
|
74
77
|
|
|
78
|
+
// Exit early when fees are unknown but fee filters are specified
|
|
79
|
+
if (!feeRates.length && !!filters.find(isFeeFilter)) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
75
83
|
if (!!feeRates.length) {
|
|
76
84
|
variables.inbound_base_fee = maxBaseFee;
|
|
77
85
|
variables.inbound_fee_rate = maxFeeRate;
|