Skip to content

Commit 6424efc

Browse files
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

14 files changed

+141
-14
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
# 0.7.0-rc.25 (Synonym Fork)
1+
# 0.7.0-rc.27 (Synonym Fork)
22

33
## Bug Fixes
44

5+
- Fixed `PeerStore::add_peer` silently ignoring address updates for existing peers. When a peer's
6+
IP address changes (e.g., LSP node migration), `add_peer` now upserts the socket address and
7+
re-persists, instead of returning early. This fixes the issue where ldk-node's reconnection loop
8+
would indefinitely use a stale cached IP after an LSP node IP change.
9+
(See [upstream issue #700](https://github.com/lightningdevkit/ldk-node/issues/700))
510
- Backported upstream Electrum sync fix (PR #4341): Skip unconfirmed `get_history` entries in
611
`ElectrumSyncClient`. Previously, mempool entries (height=0 or -1) were incorrectly treated as
712
confirmed, causing `get_merkle` to fail for 0-conf channel funding transactions.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ exclude = ["bindings/uniffi-bindgen"]
44

55
[package]
66
name = "ldk-node"
7-
version = "0.7.0-rc.25"
7+
version = "0.7.0-rc.27"
88
authors = ["Elias Rohrer <dev@tnull.de>"]
99
homepage = "https://lightningdevkit.org/"
1010
license = "MIT OR Apache-2.0"

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
import PackageDescription
55

6-
let tag = "v0.7.0-rc.25"
7-
let checksum = "3abf83a20d41a79337b9eae1c86da375b49423d5fe5176e4876b76285fde44ee"
6+
let tag = "v0.7.0-rc.27"
7+
let checksum = "c09c40d6bc96c0850f0f259c6a498893becad81a62ab8df877e0b06d5b0057a8"
88
let url = "https://github.com/synonymdev/ldk-node/releases/download/\(tag)/LDKNodeFFI.xcframework.zip"
99

1010
let package = Package(

bindings/kotlin/ldk-node-android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ org.gradle.jvmargs=-Xmx1536m
22
android.useAndroidX=true
33
android.enableJetifier=true
44
kotlin.code.style=official
5-
libraryVersion=0.7.0-rc.25
5+
libraryVersion=0.7.0-rc.27

0 commit comments

Comments
 (0)