//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()); }
//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()); }
//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(); }
//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(); }