src/Stratis.Features.FederatedPeg/TargetChain/MaturedBlocksSyncManager.cs
/// <summary>Continuously requests matured blocks from another chain.</summary>
Continuously requests matured blocks from another chain.
Continuously requests matured blocks from another chain .
private async Task RequestMaturedBlocksContinouslyAsync()
        {
            try
            {
                await Task.Delay(InitializationDelayMs, this.cancellation.Token).ConfigureAwait(false);
                while (!this.cancellation.IsCancellationRequested)
                {
                    bool delayRequired = await this.SyncBatchOfBlocksAsync(this.cancellation.Token).ConfigureAwait(false);
                    if (delayRequired)
                    {
                        await Task.Delay(RefreshDelayMs, this.cancellation.Token).ConfigureAwait(false);
                    }
                }
            }
            catch (OperationCanceledException)
            {
                this.logger.LogTrace("(-)[CANCELLED]");
            }
        }
private async Task RequestMaturedBlocksContinouslyAsync ( ) { try { await Task . Delay ( InitializationDelayMs , this . cancellation . Token ) . ConfigureAwait ( false ) ; while ( ! this . cancellation . IsCancellationRequested ) { bool delayRequired = await this . SyncBatchOfBlocksAsync ( this . cancellation . Token ) . ConfigureAwait ( false ) ; if ( delayRequired ) { await Task . Delay ( RefreshDelayMs , this . cancellation . Token ) . ConfigureAwait ( false ) ; } } } catch ( OperationCanceledException ) { this . logger . LogTrace ( " " ) ; } }
Continuously requests matured blocks from another chain.
Continuously requests matured blocks from another chain .
// Initialization delay. // Give other node some time to start API service. // Since we are synced or had a problem syncing there is no need to ask for more blocks right away. // Therefore awaiting for a delay during which new block might be accepted on the alternative chain // or alt chain node might be started.