mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-27 14:11:04 +02:00
refactor: use maps.Copy for cleaner map handling
Signed-off-by: xinhangzhou <shuangcui@aliyun.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"crypto/rand"
|
||||
"errors"
|
||||
"fmt"
|
||||
"maps"
|
||||
"math/big"
|
||||
"net"
|
||||
"sync"
|
||||
@@ -1252,9 +1253,7 @@ func (c *client) handleNewTower(tower *Tower) error {
|
||||
return fmt.Errorf("unable to determine sessions for tower %x: "+
|
||||
"%v", tower.IdentityKey.SerializeCompressed(), err)
|
||||
}
|
||||
for id, session := range sessions {
|
||||
c.candidateSessions[id] = session
|
||||
}
|
||||
maps.Copy(c.candidateSessions, sessions)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user