internal void SwitchToChain(ChainedHeaderTree cht, ChainedHeader chainTip, ChainedHeader consumedHeader, int extensionSize) { ChainedHeader[] consumedHeaders = consumedHeader.ToArray(extensionSize); for (int i = 0; i < extensionSize; i++) { ChainedHeader currentConsumedCh = consumedHeaders[i]; cht.BlockDataDownloaded(currentConsumedCh, chainTip.GetAncestor(currentConsumedCh.Height).Block); cht.PartialValidationSucceeded(currentConsumedCh, out bool fullValidationRequired); cht.ConsensusTipChanged(currentConsumedCh); } }