Exemplo n.º 1
0
        public async Task <bool> Contains(Offer of, bool first = true, int limit = 20, int count = 0)
        {
            if (count == limit)
            {
                return(false);
            }

            count++;

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

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

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

            return(false);
        }
Exemplo n.º 2
0
        public async Task <bool> Contains(Offer of, bool first = true)
        {
            if (first && (await Pool.Contains(of) || BookManager.ContainsOffer(of)))
            {
                return(true);
            }

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

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

            return(false);
        }