Skip to content

Commit d3e5b2f

Browse files
authored
Merge pull request #8584 from yyforyongyu/fix-unit-race
chainntnfs: fix race in `TestInterfaces`
2 parents fa2b0ca + bf79971 commit d3e5b2f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

chainntnfs/test/test_interface.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,7 +1893,6 @@ func TestInterfaces(t *testing.T, targetBackEnd string) {
18931893
// play around with.
18941894
miner := unittest.NewMiner(t, unittest.NetParams, nil, true, 25)
18951895

1896-
rpcConfig := miner.RPCConfig()
18971896
p2pAddr := miner.P2PAddress()
18981897

18991898
log.Printf("Running %v ChainNotifier interface tests",
@@ -1953,10 +1952,10 @@ func TestInterfaces(t *testing.T, targetBackEnd string) {
19531952
}
19541953

19551954
case "btcd":
1956-
configCopy := rpcConfig
1955+
rpcConfig := miner.RPCConfig()
19571956
newNotifier = func() (chainntnfs.TestChainNotifier, error) {
19581957
return btcdnotify.New(
1959-
&configCopy, unittest.NetParams,
1958+
&rpcConfig, unittest.NetParams,
19601959
hintCache, hintCache, blockCache,
19611960
)
19621961
}

0 commit comments

Comments
 (0)