coblox / nectar

GNU General Public License v3.0
0 stars 1 forks source link

Taker persistence #59

Closed luckysori closed 4 years ago

luckysori commented 4 years ago

Patch https://github.com/coblox/nectar/commit/9a96fe45b9135a21e7a60cb5981bccd5275df078 fixes a bug where we were calling the opposite function in the one implemented SwapKind branch when executing swaps (Thanks, @tcharding).

The rest of the work (in https://github.com/coblox/nectar/commit/75235bf60231f8951df835e9dbfc1d5618596699) was done to ensure that the logic of keeping a maximum of 1 active order/swap per taker is also applied to swaps that have been respawned after restarting Nectar.

To achieve that we save the ActiveTakers (renamed from PeersWithOngoingSwaps) to a database and we add the taker's PeerId to SwapParams.

The ActiveTakers functionality has moved to the network layer. This also allows us to more readily ignore TakeOrderRequests from active takers.