<commit_before>﻿using NBitcoin;

namespace Stratis.Bitcoin.BlockPulling
{

	public class StoreBlockPuller : BlockPuller
	{
		public StoreBlockPuller(ConcurrentChain chain, Connection.IConnectionManager nodes) 
			: base(chain, nodes.ConnectedNodes, nodes.NodeSettings.ProtocolVersion)
		{
		}

		public void AskBlock(ChainedBlock downloadRequest)
		{
			base.AskBlocks(new ChainedBlock[] { downloadRequest });
		}

		public bool TryGetBlock(ChainedBlock chainedBlock, out DownloadedBlock block)
		{
			if (this.DownloadedBlocks.TryRemove(chainedBlock.HashBlock, out block))
			{
				return true;
			}

			this.OnStalling(chainedBlock);
			return false;
		}
	}

}<commit_msg>Adding and fixing comments to have proper XML doc<commit_after>﻿using NBitcoin;

namespace Stratis.Bitcoin.BlockPulling
{
    /// <summary>
    /// Puller that download blocks from peers.
    /// </summary>
    public class StoreBlockPuller : BlockPuller
    {
        /// <summary>
        /// Initializes a new instance of the object having a chain of block headers and a list of available nodes. 
        /// </summary>
        /// <param name="chain">Chain of block headers.</param>
        /// <param name="nodes">Network peers of the node.</param>
        public StoreBlockPuller(ConcurrentChain chain, Connection.IConnectionManager nodes)
            : base(chain, nodes.ConnectedNodes, nodes.NodeSettings.ProtocolVersion)
        {
        }

        /// <inheritdoc />
        public void AskBlock(ChainedBlock downloadRequest)
        {
            base.AskBlocks(new ChainedBlock[] { downloadRequest });
        }


        /// <summary>
        /// Tries to retrieve a specific downloaded block from the list of downloaded blocks.
        /// </summary>
        /// <param name="chainedBlock">Header of the block to retrieve.</param>
        /// <param name="block">If the function succeeds, the downloaded block is returned in this parameter.</param>
        /// <returns>true if the function succeeds, false otherwise.</returns>
        public bool TryGetBlock(ChainedBlock chainedBlock, out DownloadedBlock block)
        {
            if (this.DownloadedBlocks.TryRemove(chainedBlock.HashBlock, out block))
            {
                return true;
            }

            this.OnStalling(chainedBlock);
            return false;
        }
    }
}
{'fraction_non_alphanumeric': 0.09739427595044853, 'fraction_numerical': 0.0, 'mean_word_length': 2.597542242703533, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5519126', 'n_tokens_mistral': 670, 'n_tokens_neox': 616, 'n_words': 169}