Commit 6424efc
fix: upsert peer address on connect and bump to v0.7.0-rc.27
PeerStore::add_peer previously returned early if a peer already existed,
silently discarding address updates. When an LSP node's IP changed, the
reconnection loop would indefinitely retry the stale cached address.
This commit:
1. Changes add_peer to upsert: if the peer exists but the address
differs, update and re-persist it.
2. Reorders Node::connect to persist the peer *before* attempting the
connection, so the new address is saved even if the connection
races with an in-flight reconnection attempt at the old address.
3. Adds unit tests for the upsert logic and an integration test for
persist-on-failed-connect.
See upstream issue lightningdevkit#700.
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 011a94e commit 6424efc
File tree
14 files changed
+141
-14
lines changed- bindings
- kotlin
- ldk-node-android
- lib/src/main/jniLibs
- arm64-v8a
- armeabi-v7a
- x86_64
- ldk-node-jvm
- lib/src/main/resources
- darwin-aarch64
- darwin-x86-64
- python
- src
- tests
14 files changed
+141
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
5 | 10 | | |
6 | 11 | | |
7 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
0 commit comments