Commit 66c1b92
Fix issue where mutex is acquired after state is read in
Fixes a subtle bug: when multiple `wallet_watchAsset` calls of ERC20
tokens are batched, only the last of the tokens added was getting added
because the calls were not properly single threaded, since the mutex was
acquired after reading state in the `addToken` call.
## TokensController
### Fixes
- Fixes bug where batched addToken calls overwrite each other because
mutex is acquired after reading stateaddToken resulting in overwritten state with batched addToken/watchAsset calls (#1768)1 parent 37fafbf commit 66c1b92
File tree
2 files changed
+85
-5
lines changed- packages/assets-controllers/src
2 files changed
+85
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
2 | 6 | | |
3 | 7 | | |
4 | 8 | | |
| |||
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
63 | 84 | | |
64 | | - | |
| 85 | + | |
65 | 86 | | |
66 | 87 | | |
67 | 88 | | |
| |||
93 | 114 | | |
94 | 115 | | |
95 | 116 | | |
96 | | - | |
| 117 | + | |
97 | 118 | | |
98 | 119 | | |
99 | 120 | | |
| |||
1094 | 1115 | | |
1095 | 1116 | | |
1096 | 1117 | | |
| 1118 | + | |
1097 | 1119 | | |
1098 | 1120 | | |
1099 | 1121 | | |
| |||
1365 | 1387 | | |
1366 | 1388 | | |
1367 | 1389 | | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
1368 | 1446 | | |
1369 | 1447 | | |
1370 | 1448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
303 | 302 | | |
| 303 | + | |
| 304 | + | |
304 | 305 | | |
305 | 306 | | |
306 | 307 | | |
| |||
309 | 310 | | |
310 | 311 | | |
311 | 312 | | |
312 | | - | |
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| 324 | + | |
324 | 325 | | |
325 | 326 | | |
| 327 | + | |
326 | 328 | | |
327 | 329 | | |
328 | 330 | | |
| |||
0 commit comments