Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Neo.CLI/CLI/MainService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ public void CreateWallet(string path, string password, bool createDefaultAccount
}
wallet.Save();

if (CurrentWallet is not null) SignerManager.UnregisterSigner(CurrentWallet.Name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does SignerManager's role overlap with IWalletProvider's?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IWalletProvider covers access to the currently active wallet. SignerManager is being used as an ISigner registry to centralize signing (and potentially support other signers beyond wallets). That said I agree an improvement would be to have SignerManager automatically stay in sync by subscribing to IWalletProvider.WalletChanged (e.g. as a follow-up) so we don’t need to manually Register/Unregister in every wallet changing command

CurrentWallet = wallet;
SignerManager.RegisterSigner(wallet.Name, wallet);
}
Expand Down
Loading