Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Race condition in startAuction #54

Closed
Arachnid opened this issue Mar 21, 2017 · 2 comments
Closed

Race condition in startAuction #54

Arachnid opened this issue Mar 21, 2017 · 2 comments

Comments

@Arachnid
Copy link
Member

startAuction and startAuctions throw if the auction was already in progress. This results in a race condition, where if two people open the same auction, one selected at random will get an error.

Instead, we should silently do nothing if the auction was already running, and only throw if the name is in a different state (owned, forbidden, reveal).

@alexvandesande
Copy link
Collaborator

Why not return it on owned and forbidden also? It would actually make one scenario easier: when opening multiple auctions I could put some that were randomly selected from the preimage list, to further hide the true intent. I can't do it now as there would always be a chance of some names being owned and throwing the whole thing.

Maybe just add a true false return and never throw in this case

@Arachnid
Copy link
Member Author

I don't think I agree; trying to set something to 'auction' when it already is is a noop, but trying to set something to 'auction' when it's in a state that cannot transition to auction should always be an error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants