Skip to content

Commit

Permalink
remove default count, rename class
Browse files Browse the repository at this point in the history
  • Loading branch information
ixje committed Nov 7, 2019
1 parent 316b4a5 commit 97f8d8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

namespace Neo.Network.P2P.Payloads
{
public class GetFullBlocksPayload : ISerializable
public class GetBlockDataPayload : ISerializable
{
private const ushort MaxBlocksCount = 500;
public uint IndexStart;
public ushort Count;

public int Size => sizeof(uint) + sizeof(ushort);

public static GetFullBlocksPayload Create(uint index_start, ushort count = 500)
public static GetBlockDataPayload Create(uint index_start, ushort count)
{
return new GetFullBlocksPayload
return new GetBlockDataPayload
{
IndexStart = index_start,
Count = count
Expand Down
4 changes: 2 additions & 2 deletions neo/Network/P2P/ProtocolHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected override void OnReceive(object message)
OnGetBlocksMessageReceived((GetBlocksPayload)msg.Payload);
break;
case MessageCommand.GetBlockData:
OnGetBlockDataMessageReceived((GetFullBlocksPayload)msg.Payload);
OnGetBlockDataMessageReceived((GetBlockDataPayload)msg.Payload);
break;
case MessageCommand.GetData:
OnGetDataMessageReceived((InvPayload)msg.Payload);
Expand Down Expand Up @@ -178,7 +178,7 @@ private void OnGetBlocksMessageReceived(GetBlocksPayload payload)
Context.Parent.Tell(Message.Create(MessageCommand.Inv, InvPayload.Create(InventoryType.Block, hashes.ToArray())));
}

private void OnGetBlockDataMessageReceived(GetFullBlocksPayload payload)
private void OnGetBlockDataMessageReceived(GetBlockDataPayload payload)
{
for (uint i = payload.IndexStart, max = payload.IndexStart + payload.Count; i < max; i++)
{
Expand Down

0 comments on commit 97f8d8b

Please sign in to comment.