BitSharper.BlockChain.GetPartialChain C# (CSharp) Method

GetPartialChain() private method

Returns the set of contiguous blocks between 'higher' and 'lower'. Higher is included, lower is not.
private GetPartialChain ( StoredBlock higher, StoredBlock lower ) : IList
higher StoredBlock
lower StoredBlock
return IList
        private IList<StoredBlock> GetPartialChain(StoredBlock higher, StoredBlock lower)
        {
            Debug.Assert(higher.Height > lower.Height);
            var results = new LinkedList<StoredBlock>();
            var cursor = higher;
            while (true)
            {
                results.AddLast(cursor);
                cursor = cursor.GetPrev(_blockStore);
                Debug.Assert(cursor != null, "Ran off the end of the chain");
                if (cursor.Equals(lower)) break;
            }
            return results.ToList();
        }