Пример #1
0
        public async Task <bool> Contains(OfferCancel of, bool first = true, int limit = 20, int count = 0)
        {
            if (count == limit)
            {
                return(false);
            }

            count++;

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

            if (CurrentBlock != null)
            {
                if (CurrentBlock.OffersCancelDictionary.ContainsKey(of.HashStr))
                {
                    return(true);
                }

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

            return(false);
        }
Пример #2
0
        public async Task <bool> Append(OfferCancel of)
        {
            if (!await Contains(of))
            {
                return(await Pool.Add(of));
            }

            return(false);
        }
Пример #3
0
        public async Task <bool> Contains(OfferCancel of, bool first = true)
        {
            if (first && await Pool.Contains(of))
            {
                return(true);
            }

            if (CurrentBlock != null)
            {
                if (CurrentBlock.OffersCancelDictionary.ContainsKey(of.HashStr))
                {
                    return(true);
                }

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

            return(false);
        }