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 2024-03-18 08:57:55 +01:00
parent ab422ba184
commit 17b93db5cc
No known key found for this signature in database
GPG key ID: 8E4256593F177720

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,
)
}