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
1 changed files with 2 additions and 1 deletions
|
@ -714,7 +714,8 @@ func (a *AddrManager) AddressCache() []*btcwire.NetAddress {
|
||||||
i := 0
|
i := 0
|
||||||
// Iteration order is undefined here, but we randomise it anyway.
|
// Iteration order is undefined here, but we randomise it anyway.
|
||||||
for _, v := range a.addrIndex {
|
for _, v := range a.addrIndex {
|
||||||
allAddr[i] = v.na
|
copyNa := *v.na
|
||||||
|
allAddr[i] = ©Na
|
||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
// Fisher-Yates shuffle the array
|
// Fisher-Yates shuffle the array
|
||||||
|
|
Loading…
Reference in a new issue