Beispiel #1
0
        internal async void StartInitializingQBitNinjaWallet()
        {
            await Task.Run(() =>
            {
                InitializationState           = State.NotStarted;
                InitializationProgressPercent = 0;
                List <string> outOfSyncAddresses;
                do
                {
                    outOfSyncAddresses = GetOutOfSyncAddresses();
                    AdjustState(AddressCount - outOfSyncAddresses.Count);

                    if (outOfSyncAddresses.Count == 0)
                    {
                        continue;
                    }

                    foreach (var address in outOfSyncAddresses)
                    {
                        AdjustState(outOfSyncAddresses.IndexOf(address));
                        _qBitNinjaWalletClient.CreateAddressIfNotExists(new BitcoinPubKeyAddress(address));
                    }
                } while (outOfSyncAddresses.Count != 0);
            });

            PeriodicUpdate();
        }