mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-13 02:11:03 +02:00
chainntnfs: fix race unit test issue
Because we pass in the same config into multiple notifiers, we sometimes get a data race in the unit tests. By creating a copy of the config we avoid that.
This commit is contained in:
parent
ab422ba184
commit
17b93db5cc
@ -1953,9 +1953,10 @@ func TestInterfaces(t *testing.T, targetBackEnd string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case "btcd":
|
case "btcd":
|
||||||
|
configCopy := rpcConfig
|
||||||
newNotifier = func() (chainntnfs.TestChainNotifier, error) {
|
newNotifier = func() (chainntnfs.TestChainNotifier, error) {
|
||||||
return btcdnotify.New(
|
return btcdnotify.New(
|
||||||
&rpcConfig, unittest.NetParams,
|
&configCopy, unittest.NetParams,
|
||||||
hintCache, hintCache, blockCache,
|
hintCache, hintCache, blockCache,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user