mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
eth/filers: nit: take lock when reading api.filters
This commit is contained in:
parent
623b17ba20
commit
4c23b4bd29
1 changed files with 2 additions and 0 deletions
|
|
@ -601,7 +601,9 @@ func TestPendingTxFilterDeadlock(t *testing.T) {
|
||||||
subs := make([]*Subscription, 20)
|
subs := make([]*Subscription, 20)
|
||||||
for i := 0; i < len(subs); i++ {
|
for i := 0; i < len(subs); i++ {
|
||||||
fid := api.NewPendingTransactionFilter(nil)
|
fid := api.NewPendingTransactionFilter(nil)
|
||||||
|
api.filtersMu.Lock()
|
||||||
f, ok := api.filters[fid]
|
f, ok := api.filters[fid]
|
||||||
|
api.filtersMu.Unlock()
|
||||||
if !ok {
|
if !ok {
|
||||||
t.Fatalf("Filter %s should exist", fid)
|
t.Fatalf("Filter %s should exist", fid)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue