Streamline isMakerBlacklisted() logic

This commit is contained in:
F. Eugene Aumson 2020-09-16 17:37:31 -04:00
parent 79e0a9ef37
commit ec08715090
No known key found for this signature in database
GPG Key ID: 23E6737B1374A24A

View File

@ -24,15 +24,10 @@ export class RfqMakerBlacklist {
} }
} }
public isMakerBlacklisted(makerUrl: string): boolean { public isMakerBlacklisted(makerUrl: string): boolean {
if (this._makerBlacklistedUntilDate.hasOwnProperty(makerUrl)) { const now = Date.now();
if (this._makerBlacklistedUntilDate[makerUrl] > Date.now()) { if (now > this._makerBlacklistedUntilDate[makerUrl]) {
delete this._makerBlacklistedUntilDate[makerUrl]; delete this._makerBlacklistedUntilDate[makerUrl];
return false;
} else {
return true;
}
} else {
return false;
} }
return this._makerBlacklistedUntilDate[makerUrl] > now;
} }
} }