Exemplo n.º 1
0
        //Do not get all entries, but only the one you can generate with spent/unspent.
        public AccountEntry[] GetInChain(Chain chain, bool value)
        {
            Dictionary <OutPoint, AccountEntry> entries = new Dictionary <OutPoint, AccountEntry>();

            foreach (var entry in AccountEntries)
            {
                if (entry.Block == null)
                {
                    continue;
                }

                if (chain.Contains(entry.Block, false) == value)
                {
                    if (entry.Reason == AccountEntryReason.Income && _Unspent.ContainsKey(entry.Spendable.OutPoint))
                    {
                        entries.AddOrReplace(entry.Spendable.OutPoint, entry);
                    }
                    if (entry.Reason == AccountEntryReason.ChainBlockChanged && !_Unspent.ContainsKey(entry.Spendable.OutPoint))
                    {
                        entries.AddOrReplace(entry.Spendable.OutPoint, entry);
                    }
                }
            }
            return(entries.Values.ToArray());
        }
Exemplo n.º 2
0
        //Do not get all entries, but only the one you can generate with spent/unspent.
        public AccountEntry[] GetInChain(Chain chain, bool value)
        {
            List <AccountEntry> entries = new List <AccountEntry>();

            foreach (var entry in AccountEntries.Where(e => e.Reason != AccountEntryReason.ChainBlockChanged))
            {
                if (entry.Block == null)
                {
                    continue;
                }

                if (chain.Contains(entry.Block, false) == value)
                {
                    entries.Add(entry);
                }
            }
            return(entries.ToArray());
        }
Exemplo n.º 3
0
        //Do not get all entries, but only the one you can generate with spent/unspent.
        public AccountEntry[] GetInChain(Chain chain, bool value)
        {
            Dictionary<OutPoint, AccountEntry> entries = new Dictionary<OutPoint, AccountEntry>();
            foreach(var entry in AccountEntries)
            {
                if(entry.Block == null)
                    continue;

                if(chain.Contains(entry.Block, false) == value)
                {
                    if(entry.Reason == AccountEntryReason.Income && _Unspent.ContainsKey(entry.Spendable.OutPoint))
                        entries.AddOrReplace(entry.Spendable.OutPoint, entry);
                    if(entry.Reason == AccountEntryReason.ChainBlockChanged && !_Unspent.ContainsKey(entry.Spendable.OutPoint))
                        entries.AddOrReplace(entry.Spendable.OutPoint, entry);
                }
            }
            return entries.Values.ToArray();
        }
Exemplo n.º 4
0
        //Do not get all entries, but only the one you can generate with spent/unspent.
        public AccountEntry[] GetInChain(Chain chain, bool value)
        {
            List<AccountEntry> entries = new List<AccountEntry>();
            foreach(var entry in AccountEntries.Where(e => e.Reason != AccountEntryReason.ChainBlockChanged))
            {
                if(entry.Block == null)
                    continue;

                if(chain.Contains(entry.Block, false) == value)
                {
                    entries.Add(entry);
                }
            }
            return entries.ToArray();
        }