mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-23 22:46:40 +01:00
routerrpc: fix loop variable binding bug in querymc
This bug caused all node pubkey to be the same.
This commit is contained in:
parent
0e28ecd616
commit
e2af3c0fa7
1 changed files with 4 additions and 1 deletions
|
@ -445,7 +445,10 @@ func (s *Server) QueryMissionControl(ctx context.Context,
|
|||
snapshot := s.cfg.RouterBackend.MissionControl.GetHistorySnapshot()
|
||||
|
||||
rpcNodes := make([]*NodeHistory, len(snapshot.Nodes))
|
||||
for i, node := range snapshot.Nodes {
|
||||
for i, n := range snapshot.Nodes {
|
||||
// Copy node struct to prevent loop variable binding bugs.
|
||||
node := n
|
||||
|
||||
channels := make([]*ChannelHistory, len(node.Channels))
|
||||
for j, channel := range node.Channels {
|
||||
channels[j] = &ChannelHistory{
|
||||
|
|
Loading…
Add table
Reference in a new issue