mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-12 14:12:27 +02:00
Merge pull request #5839 from ellemouton/noDuplicateConnsForDupAddrs
server: use deduped addrMap for connReq creation
This commit is contained in:
@ -464,6 +464,9 @@ you.
|
|||||||
certain channels couldn't be passed to `lncli getchaninfo` due to their 8-byte
|
certain channels couldn't be passed to `lncli getchaninfo` due to their 8-byte
|
||||||
compact ID being too large for an int64.
|
compact ID being too large for an int64.
|
||||||
|
|
||||||
|
* [Dedup stored peer addresses before creating connection requests to prevent
|
||||||
|
redundant connection requests](https://github.com/lightningnetwork/lnd/pull/5839)
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
The [code contribution guidelines have been updated to mention the new
|
The [code contribution guidelines have been updated to mention the new
|
||||||
|
@ -3771,11 +3771,7 @@ func (s *server) connectToPersistentPeer(pubKeyStr string) {
|
|||||||
|
|
||||||
// Any addresses left in addrMap are new ones that we have not made
|
// Any addresses left in addrMap are new ones that we have not made
|
||||||
// connection requests for. So create new connection requests for those.
|
// connection requests for. So create new connection requests for those.
|
||||||
for _, addr := range s.persistentPeerAddrs[pubKeyStr] {
|
for _, addr := range addrMap {
|
||||||
if _, ok := addrMap[addr.String()]; !ok {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
connReq := &connmgr.ConnReq{
|
connReq := &connmgr.ConnReq{
|
||||||
Addr: addr,
|
Addr: addr,
|
||||||
Permanent: true,
|
Permanent: true,
|
||||||
|
Reference in New Issue
Block a user