-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This removes the swap state gob files, loading necessary data from the DB on Swapper startup. server/db Add `SwapArchiver.ActiveSwaps` (impl. by `(*Archiver).ActiveSwaps`) to retrieve full details of all active swaps across all markets. `Swapper`'s constructor uses this to resume active swaps. Remove all the swap state hash get/set functions. The `meta` table and it's `state_hash` column still exist, but I think I'm going to entirely drop this table and follow up with a PR that re-adds the meta table with a versioning scheme. server/swap Rip out: - All of the swap state/gob stuff. - The `orderSwapTracker`, which was used to infer order "completion" for the cancellation rate computations. The market now has these order fill/settlement/success responsibilities. A `swapDone` callback is provided to the `Swapper` from the consumer (DEX manager) to do this. - The `offBook` argument of `Negotiate`, which was used with the `orderSwapTracker` junk. - The the live waiter tracking. Clients retry init/redeem requests now, so jumping through hoops to recreate live coin waiters on swapper startup is not necessary. The Swapper constructor now loads all active matches from the DB and reconstructs all of the `matchTrackers`. This uses the new `Backend.CoinConfTime` method for the `SwapConfirmTime`, which is not stored in the DB. The match request time field of `matchTracker` is also not recorded, so this is guessed on resume as the epoch close time plus a minute, which at worst gives the maker a little extra breathing room when resuming in `NewlyMatched` status. server/market Assume the responsibility of deciding when an order is successfully "completed" as per the cancellation rate definition. This is facilitated by the `SwapDone` method that the DEX manager bridges with the `Swapper`. The `SwapDone` method also performs the same unbooking that the Swapper previous requested via the `unbookHook`, now removed. server/dex Remove the unbook hook, replacing it with a `swapDone` dispatcher. server/auth `Sign` no longer returns an error since the secp256k1 changes recently eliminated the error return.
- Loading branch information
Showing
25 changed files
with
645 additions
and
1,548 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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.