Fix race-condition bug

This commit is contained in:
Fabio Berger 2019-04-23 18:05:33 -05:00
parent 600b86dd31
commit 8d3ccf333d

View File

@ -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);