-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
client/core: blind cancel of unknown orders reported on connect
There are a variety of pathological circumstances in which the client can be unaware of orders that the server claims are active (in epoch or booked status on the server). These include using an old or corrupt DB file that lacks current orders, errors saving submitted orders, and such trades having been self-revoked such as if the server were down past the taker's locktime. Each of these scenarios has been encountered in the wild. This change introduces a simple "blind cancel" mechanism for submitting cancel orders for any of the orders reported by the server on connect that are not presently "active" according to the client. In submitting these cancels, no accompanying tracked trade is present, only an entry in the new blindCancels map. This map facilitates handling of the preimage request for the order (if is accepted), as well as silencing errors that would occur in the match/nomatch handlers. Future work should introduce a method for manually self-revoking orders while the DEX connection is down. Presently, this code will only be used for the anomolous cases described above.
- Loading branch information
Showing
1 changed file
with
137 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters