-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
client: don't lock in PromptShutdown, do it on Core shutdown
Lock and stop wallets after other Core goroutines. Previously we gave `(*Core).PromptShutdown` the expanded responsibility of not just checking and prompting if a shutdown was OK but also locking the wallets. This was not the right place to do that for several reasons: 1. `PromptShutdown` is just a check and prompt function, not a "partial shutdown" function. Shutdown via context cancellation is the correct approach. 2. `Core` consumers could and were not using `PromptShutdown`, and instead just cancelling `Core`'s context thus leaving the wallets unlocked after shutdown, thus leading to the now-fixed "wallet not unlocked" bug (8ff4d94) that was requiring such consumers to also restart their wallets when restarting. 3. Locking the wallets and the dex accounts before shutting down `(*Core).Run` goroutine was incorrect. After the DB and `dexConnection`s stop, the wallets may be locked and dex account private keys cleared. * client/core: (*xcWallet).Connect must Disconnect on error If (*xcWallet).Connect passed the call to connector.Connect, but any of the remaining calls such as SyncStatus and OwnsAddress failed, Connect would return a non-nil error and leave hookedUp=false. However the dex.ConnectionMaster (connector) was still connected. This modifies (*xcWallet).Connect to Disconnect on any such error. Also, with the newly-safe dex.(*ConnectionMaster).Disconnect method, we now just call (*xcWallet).Disconnected without having to infer if it is safe via (*xcWallet).connected. * lock wallet before disconnect in CreateWallet and setWalletPassword
- Loading branch information
Showing
5 changed files
with
97 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters