`addpeer` not working

Open
#11,435 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
go
Domain
networking

Research direction

Start with the addpeer startup handling and the server log path that removes the connection request, then compare that flow with the successful lncli connect path. Check how the peer address is stored and surfaced by getnodeinfo; the issue gives no file or test names, so locate relevant tests before changing code. Done means peers behind NAT reconnect to the specified IPs after restart without adding private IPs to announcements.

Written by the indexing model from the issue text.

Description

I'm running v0.21.5-beta on mainnet.

I have several nodes running a private network with channels between them. The nodes have connection to the internet, but are behind NAT and have no ports forwarded.

I've recently changed some of their IP addresses as part of a network restructuring.

I try to use addpeer to specify the peer IP addresses on startup to the correct new IP addresses, but this does not work, the peers don't connect and I get inactive channels.

In the log I see

2026-10-28 15:28:49.628 [INF] SRVR: Removing conn req: [REDACTED]

for the peer that was added via addpeer.

Also, getnodeinfo just shows "addresses": [] for the peer.

If I use lncli connect after starting, I can connect to the peer and the channels become active, but I don't want to have to do that after each restart (see also https://github.com/lightningnetwork/lnd/issues/10870). I also done want to add my private network IP addresses to my node announcement messages.

Dominant language
Go
Stars
8.2k
Forks
2.3k
Avg merge
1d 11h
Merged PRs (30d)
103

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lightningnetwork/lnd

All issues in lightningnetwork/lnd

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.