Example #1
0
        public async Task <bool> Contains(Withdrawal wd, bool first = true, int limit = 20, int count = 0)
        {
            if (count == limit)
            {
                return(false);
            }

            count++;

            if (first && await Pool.Contains(wd))
            {
                return(true);
            }

            if (CurrentBlock != null)
            {
                if (CurrentBlock.WithdrawalsDictionary.ContainsKey(wd.HashStr))
                {
                    return(true);
                }

                if (Previous != null)
                {
                    return(await Previous.Contains(wd, false, limit, count));
                }
            }

            return(false);
        }
Example #2
0
        public async Task <bool> Append(Withdrawal wd)
        {
            if (!await Contains(wd))
            {
                return(await Pool.Add(wd));
            }

            return(false);
        }
Example #3
0
        public async Task <bool> Contains(Withdrawal wd, bool first = true)
        {
            if (first && await Pool.Contains(wd))
            {
                return(true);
            }

            if (CurrentBlock != null)
            {
                if (CurrentBlock.WithdrawalsDictionary.ContainsKey(wd.HashStr))
                {
                    return(true);
                }

                if (Previous != null)
                {
                    return(await Previous.Contains(wd, false));
                }
            }

            return(false);
        }