skycoin / teller

Skycoin exchange service
15 stars 30 forks source link

Change api_enabled to send_enabled and bind_enabled #196

Closed gz-c closed 6 years ago

gz-c commented 6 years ago

Fixes #184

web.api_enabled is replaced with teller.bind_enabled and sky_exchanger.send_enabled.

If teller.bind_enabled is false, /api/bind returns 403 Forbidden. /api/status will still work. /api/config's return value field "enabled" is equal to teller.bind_enabled.

If sky_exchanger.send_enabled is false, the exchanger will not send any coins. It will still accept deposits from the scanner and record them, leaving them with a status_wait_send status, which can be queried via /api/status.

Reasons for these changes:

When we want to disable binding and report the OTC as "closed", we want to be able to check statuses since the exchanger can still send coins in the background, to process any remaining deposits that may have in the bitcoin network prior to closing the OTC.

Sometimes we want to continue processing these remaining deposits in the background, but sometimes we want to stop those too. Users who had already bound a BTC address could continue to purchase from the OTC while binding was disabled and the OTC said "closed". This can now be prevented with sky_exchanger.send_enabled.

In practice, to close the OTC, the operator first set teller.bind_enabled to false. Then, after waiting 15-30 minutes for any pending BTC deposits to arrive, the operator sets sky_exchanger.send_enabled to false.