lightning 10.10.1 → 10.10.3

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,13 @@
1
1
  # Versions
2
2
 
3
+ ## 10.10.3
4
+
5
+ - `getPeers`: Set minimum possible peer ping time to positive zero
6
+
7
+ ## 10.10.2
8
+
9
+ - `getChainFeeEstimate`: Add default chain fee conf target when none is passed
10
+
3
11
  ## 10.10.1
4
12
 
5
13
  - `closeChannel`, `openChannel`, `sendToChainAddress`, `sendToChainAddresses`:
@@ -3,6 +3,7 @@ const {returnResult} = require('asyncjs-util');
3
3
 
4
4
  const {isLnd} = require('./../../lnd_requests');
5
5
 
6
+ const defaultConfTarget = 6;
6
7
  const hasNumber = n => !!n && n !== '0';
7
8
  const {isArray} = Array;
8
9
  const method = 'estimateFee';
@@ -75,7 +76,7 @@ module.exports = (args, cbk) => {
75
76
  return args.lnd[type][method]({
76
77
  AddrToAmount,
77
78
  coin_selection_strategy: strategy(args.utxo_selection),
78
- target_conf: args.target_confirmations || undefined,
79
+ target_conf: args.target_confirmations || defaultConfTarget,
79
80
  min_confs: args.utxo_confirmations || undefined,
80
81
  spend_unconfirmed: args.utxo_confirmations === unconfirmedConfCount,
81
82
  },
@@ -11,6 +11,7 @@ const isString = n => typeof n === 'string';
11
11
  const isZero = n => n === '0';
12
12
  const {keys} = Object;
13
13
  const microPerMilli = 1e3;
14
+ const minTime = n => n < 1 ? 0 : n;
14
15
 
15
16
  /** Translate an RPC peer into a peer
16
17
 
@@ -124,7 +125,7 @@ module.exports = peer => {
124
125
  is_inbound: peer.inbound,
125
126
  is_sync_peer: isKnownSyncType ? isActiveSync(peer.sync_type) : undefined,
126
127
  last_reconnection: !!lastReconnected ? date(lastReconnected) : undefined,
127
- ping_time: ceil(Number(peer.ping_time) / microPerMilli),
128
+ ping_time: minTime(ceil(Number(peer.ping_time) / microPerMilli)),
128
129
  public_key: peer.pub_key,
129
130
  reconnection_rate: !!peer.flap_count ? peer.flap_count : undefined,
130
131
  socket: peer.address,
package/package.json CHANGED
@@ -53,5 +53,5 @@
53
53
  "directory": "test/typescript"
54
54
  },
55
55
  "types": "index.d.ts",
56
- "version": "10.10.1"
56
+ "version": "10.10.3"
57
57
  }
@@ -122,6 +122,11 @@ const tests = [
122
122
  description: 'RPC peer is mapped to peer details',
123
123
  expected: makeExpected({}),
124
124
  },
125
+ {
126
+ args: makePeer({ping_time: '-1'}),
127
+ description: 'Ping time is set to zero when negative',
128
+ expected: makeExpected({ping_time: 0}),
129
+ },
125
130
  {
126
131
  args: makePeer({sync_type: 'PASSIVE_SYNC'}),
127
132
  description: 'RPC passive sync peer is mapped to peer details',