Exemple #1
0
        public NxtConnector(IServiceFactory serviceFactory, string walletfile, int confirmations)
        {
            accountService     = serviceFactory.CreateAccountService();
            blockService       = serviceFactory.CreateBlockService();
            serverInfoService  = serviceFactory.CreateServerInfoService();
            this.confirmations = confirmations;

            wallet = InitWallet(walletfile);
        }
Exemple #2
0
        private NxtWalletDb InitWallet(string walletfile)
        {
            var wallet = new NxtWalletDb(walletfile);

            if (wallet.IsInitialized())
            {
                return(wallet);
            }

            var blockchainStatus = serverInfoService.GetBlockchainStatus().Result;

            wallet.Init(blockchainStatus.LastBlockId);
            return(wallet);
        }