Пример #1
0
        void LoadWalletFromFile(string walletName)
        {
            string x1WalletFilePath = walletName.GetX1WalletFilepath(C.Network, this.nodeServices.DataFolder);

            if (!File.Exists(x1WalletFilePath))
            {
                throw new FileNotFoundException($"No wallet file found at {x1WalletFilePath}");
            }

            if (this.walletManager != null)
            {
                if (this.walletManager.WalletPath != x1WalletFilePath)
                {
                    throw new NotSupportedException(
                              "Core wallet manager already created, changing the wallet file while node and wallet are running is not currently supported.");
                }
            }

            this.walletManager = new WalletManager(this.nodeServices, x1WalletFilePath);
        }
Пример #2
0
 public WalletContext(WalletManager walletManager)
 {
     this.WalletManager = walletManager ?? throw new ArgumentNullException(nameof(walletManager));
     this.WalletManager.WalletSemaphore.Wait();
 }