cryptoeax / arbbot

Arbitrator, a bitcoin/altcoin arbitrage trading bot
https://gitter.im/cryptoeax-arbbot/Lobby
GNU General Public License v3.0
199 stars 78 forks source link

Prevent Ctrl+C-ing in the middle of a trade #52

Open cryptoeax opened 6 years ago

cryptoeax commented 6 years ago

This can result in a trade that is half recorded in the DB. For example, the profit_loss table may not get updated properly, etc. It's better to disable Ctrl+Cing at the times that's not safe to do so.

claytondukes commented 6 years ago

Be aware that ctrl-c would only make a difference if it's running in the terminal - for users using systemd, a service restart would still take effect. So might be better to just check for ctrl-c, kill, HUP, etc. and notify the user that it will exit after the transaction completes.

cryptoeax commented 6 years ago

The way this would be implemented would be by handling SIGINT and a similar SIGKILL handler can be added just as easily...