mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 14:17:56 +01:00
refactor: use maps.Copy for cleaner map handling
Signed-off-by: xinhangzhou <shuangcui@aliyun.com>
This commit is contained in:
@@ -2,6 +2,7 @@ package lnd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"maps"
|
||||
"sync"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec/v2"
|
||||
@@ -66,9 +67,7 @@ func newAccessMan(cfg *accessManConfig) (*accessMan, error) {
|
||||
// We'll populate the server's peerCounts map with the counts fetched
|
||||
// via initAccessPerms. Also note that we haven't yet connected to the
|
||||
// peers.
|
||||
for peerPub, count := range counts {
|
||||
a.peerCounts[peerPub] = count
|
||||
}
|
||||
maps.Copy(a.peerCounts, counts)
|
||||
|
||||
return a, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user