We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a90672f commit 7a3a75bCopy full SHA for 7a3a75b
src/Stratis.Features.FederatedPeg/TargetChain/MaturedBlocksSyncManager.cs
@@ -152,7 +152,8 @@ public void RecordCounterChainActivations()
152
return;
153
}
154
155
- int mainChainLockedInHeight = this.chainIndexer.Tip.EnumerateToGenesis().TakeWhile(h => h.Header.Time >= (uint)(model.LockedInTimestamp)).LastOrDefault().Height;
+ // 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;
157
158
Network counterChainNetwork = this.counterChainSettings.CounterChainNetwork;
159
this.mainChainActivationHeight = mainChainLockedInHeight +
0 commit comments