Merge pull request #1789 from 0xProject/fix/order-watcher-race-condition
Fix OrderWatcher race-condition bug
This commit is contained in:
commit
18acf50b12
@ -1,4 +1,13 @@
|
||||
[
|
||||
{
|
||||
"version": "4.0.7",
|
||||
"changes": [
|
||||
{
|
||||
"note": "Fix race-condition bug due to async callback modifying shared state",
|
||||
"pr": 1789
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "4.0.6",
|
||||
"changes": [
|
||||
|
@ -493,6 +493,9 @@ export class OrderWatcher {
|
||||
private async _emitRevalidateOrdersAsync(orderHashes: string[], transactionHash?: string): Promise<void> {
|
||||
for (const orderHash of orderHashes) {
|
||||
const signedOrder = this._orderByOrderHash[orderHash];
|
||||
if (signedOrder === undefined) {
|
||||
continue;
|
||||
}
|
||||
// Most of these calls will never reach the network because the data is fetched from stores
|
||||
// and only updated when cache is invalidated
|
||||
const orderState = await this._orderStateUtils.getOpenOrderStateAsync(signedOrder, transactionHash);
|
||||
|
Loading…
x
Reference in New Issue
Block a user