mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
Copy netaddresses in AddressCache instead of referencing them.
While harmless, this prevents the race detector complaining when these are then used. Closes #94
This commit is contained in:
parent
33082445c5
commit
e20a3e9f2c
@ -714,7 +714,8 @@ func (a *AddrManager) AddressCache() []*btcwire.NetAddress {
|
||||
i := 0
|
||||
// Iteration order is undefined here, but we randomise it anyway.
|
||||
for _, v := range a.addrIndex {
|
||||
allAddr[i] = v.na
|
||||
copyNa := *v.na
|
||||
allAddr[i] = ©Na
|
||||
i++
|
||||
}
|
||||
// Fisher-Yates shuffle the array
|
||||
|
Loading…
x
Reference in New Issue
Block a user