internal static void AddHBSummary(AccountHarvestedSummary s)
        {
            var context = new AccountHarvestedSummaryDataContext();

            context.AccountHarvestedSummaries.InsertOnSubmit(entity: s);

            context.SubmitChanges();
        }
        private static void ScanBlocks(Account userAccount)
        {
            try
            {
                var aClient = new AccountClient(Con);

                aClient.BeginGetHarvestingInfo(ar =>
                {
                    try
                    {
                        if (ar.Content.data != null)
                        {
                            foreach (var t in ar.Content.data)
                            {
                                if (ar.Content.data.Count <= 0 || userAccount.LastBlockHarvestedHeight >= t?.height)
                                {
                                    continue;
                                }

                                userAccount.LastBlockHarvestedHeight = t?.height;

                                AccountUtils.UpdateAccount(
                                    usrAcc: userAccount);

                                var hb = new AccountHarvestedSummary()
                                {
                                    BlockHeight      = t.height,
                                    FeesEarned       = t.totalFee,
                                    MonitoredAccount = userAccount.EncodedAddress,
                                    DateOfInput      = DateTime.Now,
                                    OwnedByUser      = userAccount.OwnedByUser
                                };

                                try
                                {
                                    if (userAccount.CheckBlocks)
                                    {
                                        SummaryUtils.AddHBSummary(s: hb);
                                        Notify(usrAcc: userAccount, hrvData: t);
                                    }
                                }
                                catch (Exception e)
                                {
                                    if (e.Message.Contains("blocked"))
                                    {
                                        AccountUtils.DeleteAccountsByUser(userAccount.OwnedByUser);

                                        NodeUtils.DeleteUserNodes(userAccount.OwnedByUser);

                                        UserUtils.DeleteUser(userAccount.OwnedByUser);
                                    }

                                    break;
                                }
                            }
                        }
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(value: e);
                    }
                }, userAccount.EncodedAddress);
            }
            catch (Exception e)
            {
                Console.WriteLine(value: e);
            }
        }