Skip to content

Commit 7a3a75b

Browse files
committed
Add comment
1 parent a90672f commit 7a3a75b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Stratis.Features.FederatedPeg/TargetChain/MaturedBlocksSyncManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ public void RecordCounterChainActivations()
152152
return;
153153
}
154154

155-
int mainChainLockedInHeight = this.chainIndexer.Tip.EnumerateToGenesis().TakeWhile(h => h.Header.Time >= (uint)(model.LockedInTimestamp)).LastOrDefault().Height;
155+
// The above condition ensures that the 'Last' below will always return a value.
156+
int mainChainLockedInHeight = this.chainIndexer.Tip.EnumerateToGenesis().TakeWhile(h => h.Header.Time >= (uint)(model.LockedInTimestamp)).Last().Height;
156157

157158
Network counterChainNetwork = this.counterChainSettings.CounterChainNetwork;
158159
this.mainChainActivationHeight = mainChainLockedInHeight +

0 commit comments

Comments
 (0)