market: verify unspent status of unfilled orders #732
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addressing #615
When a user submits a new order, all of that user's unfilled book orders have their funding coins checked. If any of them are spent, those orders are unbooked. The newly submitted order is processed normally after that. The idea behind checking on order placement is to prevent a user from moving the same bunch of coins around into new utxos to fund a large number of bogus (unfunded) orders. Although a user could submit multiple orders with valid funding coins, then proceed to spend those coins, this user could affect similar disruption by simple not executing swaps on match, so continually checking funding coins for online users is not particularly useful. PR #725 handles users going offline.
e.g.
Notes:
revoke_order
is implemented in auth,book,market,ws: Unbook MIA users orders after a timeout #725, thus any unbooked orders are only removed from the book, but the owner does not revoke the order until they reconnect or dexc restarts. This will change automatically with the updates to (*Market).Unbook in auth,book,market,ws: Unbook MIA users orders after a timeout #725NewMarket