public int UnconfirmedSegments() { if (WindowList.Any() && (WindowList.First().StateInWindow == State.Confirmed)) { return(0); } var unconfirmedSegs = WindowList.TakeWhile(s => s.StateInWindow == State.Unconfirmed); return(unconfirmedSegs.Count()); }