Skip to content

Commit

Permalink
add timeout to connect peer method
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbosworth committed Sep 17, 2020
1 parent 0f9bc04 commit f584e61
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Versions

## 49.11.0

- `addPeer`: Allow specifying a `timeout` in milliseconds to abort a connect attempt
- `openChannels`: Fix giving tokens to peers

## 49.10.0

- `getPeers`: Return `last_reconnected` to indicate last reconnection date
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,16 @@ Add a peer if possible (not self, or already connected)

Requires `peers:write` permission

`timeout` is not supported in LND 0.11.0 and below

{
[is_temporary]: <Add Peer as Temporary Peer Bool> // Default: false
lnd: <Authenticated LND API Object>
public_key: <Public Key Hex String>
[retry_count]: <Retry Count Number>
[retry_delay]: <Delay Retry By Milliseconds Number>
socket: <Host Network Address And Optional Port String> // ip:port
[timeout]: <Connection Attempt Timeout Milliseconds Number>
}

@returns via cbk or Promise
Expand Down
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"express": "4.17.1",
"invoices": "1.1.3",
"is-base64": "1.1.0",
"lightning": "2.0.44",
"lightning": "2.0.47",
"macaroon": "3.0.4",
"morgan": "1.10.0",
"ws": "7.3.1"
Expand Down Expand Up @@ -60,5 +60,5 @@
"tower_server-integration-tests": "tap --no-coverage test/tower_serverrpc-integration/*.js",
"wallet-integration-tests": "tap --no-coverage test/walletrpc-integration/*.js"
},
"version": "49.10.0"
"version": "49.11.0"
}
1 change: 1 addition & 0 deletions test/integration/test_add_peer.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ test(`Add a peer`, async ({end, equal}) => {
lnd,
public_key: cluster.remote.public_key,
socket: cluster.remote.socket,
timeout: 1,
});

const {peers} = await getPeers({lnd});
Expand Down

0 comments on commit f584e61

Please sign in to comment.