Skip to content

Commit

Permalink
client/asset/dcr test: fix potential mutex deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
itswisdomagain committed Aug 4, 2021
1 parent 8f7a617 commit 3333748
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions client/asset/dcr/dcr_test.go
Expand Up @@ -533,6 +533,7 @@ func (c *tRPCClient) RawRequest(_ context.Context, method string, params []json.
}

c.blockchain.mtx.RLock()
defer c.blockchain.mtx.RUnlock()
blockFilterBuilder := c.blockchain.v2CFilterBuilders[blkHash]
if blockFilterBuilder == nil {
return nil, fmt.Errorf("v2cfilter builder not found for block")
Expand All @@ -546,8 +547,6 @@ func (c *tRPCClient) RawRequest(_ context.Context, method string, params []json.
Filter: hex.EncodeToString(v2CFilter.Bytes()),
Key: hex.EncodeToString(blockFilterBuilder.key[:]),
}
c.blockchain.mtx.RUnlock()

return json.Marshal(res)

case methodListUnspent:
Expand Down

0 comments on commit 3333748

Please sign in to comment.