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:
Oliver Gugger committed 2024-03-18 17:08:17 +01:00
1 parent ab422ba184
commit 17b93db5cc
1 file changed
+2 -1
+2 -1
View File
@@ -1953,9 +1953,10 @@ func TestInterfaces(t *testing.T, targetBackEnd string) {
}
case "btcd":
configCopy := rpcConfig
newNotifier = func() (chainntnfs.TestChainNotifier, error) {
return btcdnotify.New(
&rpcConfig, unittest.NetParams,
&configCopy, unittest.NetParams,
hintCache, hintCache, blockCache,
)
}