BitSharp.Network.Messaging.ConstructGetBlocksPayload C# (CSharp) Method

ConstructGetBlocksPayload() public static method

public static ConstructGetBlocksPayload ( ImmutableArray blockLocatorHashes, UInt256 hashStop ) : BitSharp.Network.GetBlocksPayload
blockLocatorHashes ImmutableArray
hashStop UInt256
return BitSharp.Network.GetBlocksPayload
        public static GetBlocksPayload ConstructGetBlocksPayload(ImmutableArray<UInt256> blockLocatorHashes, UInt256 hashStop)
        {
            return new GetBlocksPayload
            (
                Version: PROTOCOL_VERSION,
                BlockLocatorHashes: blockLocatorHashes,
                HashStop: hashStop
            );
        }
    }

Usage Example

Esempio n. 1
0
        public async Task SendGetBlocks(ImmutableArray <UInt256> blockLocatorHashes, UInt256 hashStop)
        {
            var getBlocksPayload = Messaging.ConstructGetBlocksPayload(blockLocatorHashes, hashStop);
            var getBlocksMessage = Messaging.ConstructMessage("getblocks", NetworkEncoder.EncodeGetBlocksPayload(getBlocksPayload));

            await SendMessageAsync(getBlocksMessage);
        }