Exemple #1
0
 /// <summary>
 /// Get a block fetcher of the specified chain from the specified checkpoint
 /// </summary>
 /// <param name="checkpoint">The checkpoint to load from</param>
 /// <param name="chain">The chain to fetcher (default: the Node's main chain)</param>
 /// <returns>A BlockFetcher for enumerating blocks and saving progression</returns>
 public BlockFetcher GetBlockFetcher(Checkpoint checkpoint, Node node, ChainBase chain = null)
 {
     if (checkpoint == null)
     {
         throw new ArgumentNullException("checkpoint");
     }
     if (node == null)
     {
         throw new ArgumentNullException("node");
     }
     chain = chain ?? GetNodeChain(node);
     IndexerTrace.CheckpointLoaded(chain.FindFork(checkpoint.BlockLocator), checkpoint.CheckpointName);
     return(new BlockFetcher(checkpoint, new NodeBlocksRepository(node), chain)
     {
         NeedSaveInterval = CheckpointInterval,
         FromHeight = FromHeight,
         ToHeight = ToHeight
     });
 }