Safe shutdown
siad should listen for signals and handle them properly. Specifically, it should catch a ^C
and initiate a graceful shutdown. This is crucial to prevent corruption of things like the wallet file.
Speaking of which, there's another step I think we should take to protect the wallet file. When the file is saved, it should be saved to a different file, like __wallet.new
, and then we should call os.Rename
to overwrite the old file. We can rely on the move operation to be atomic, so if siad gets interrupted it won't corrupt the old file.