Skip to content
This repository has been archived by the owner on Nov 24, 2020. It is now read-only.

Support concurrent swap requests #15

Open
tiero opened this issue Apr 24, 2020 · 2 comments
Open

Support concurrent swap requests #15

tiero opened this issue Apr 24, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@tiero
Copy link
Contributor

tiero commented Apr 24, 2020

The best strategy to achieve this would be to keep a local collection unspents for utxos (the crawler component should keep this in sync watching the chain continuously) and to create a sort of spendings collection that resembles the concept in databases of the "write-ahead log".

When a new swap it's taken and accepted by the daemon, both the unspents and the spendings collection need to be atomically updated, respectively "logically deleting" the unspent "to be consumed" by the swap in the former and inserting a "sort of" new utxo in the latter. (I say sort of because we wouldn't have yet a txid field like in the unspesnts one, but we are interested only in the value and asset field)

The balances endpoint would need to calculate the real available balance aggregating the two collection, NOT only looking in the unspents colelction, but both.

@tiero
Copy link
Contributor Author

tiero commented Apr 24, 2020

cc/ @altafan

@tiero tiero changed the title Support concurrent swaps requests Support concurrent swap requests Apr 24, 2020
@tiero tiero added the enhancement New feature or request label Apr 24, 2020
@tiero
Copy link
Contributor Author

tiero commented May 5, 2020

cc/ @lukekhamilton

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

No branches or pull requests

1 participant