From bc775840cd93f4b9a849a85ae00b56f7d4a643a6 Mon Sep 17 00:00:00 2001 From: doubiliu Date: Wed, 6 Nov 2019 22:47:07 -0600 Subject: [PATCH] Remove the case of GetData in ProtocolHandlerMailbox#ShallDrop (#1201) --- neo.UnitTests/Network/P2P/UT_ProtocolHandlerMailbox.cs | 4 ---- neo/Network/P2P/ProtocolHandler.cs | 1 - 2 files changed, 5 deletions(-) diff --git a/neo.UnitTests/Network/P2P/UT_ProtocolHandlerMailbox.cs b/neo.UnitTests/Network/P2P/UT_ProtocolHandlerMailbox.cs index cb9c4586a8..f41deead2a 100644 --- a/neo.UnitTests/Network/P2P/UT_ProtocolHandlerMailbox.cs +++ b/neo.UnitTests/Network/P2P/UT_ProtocolHandlerMailbox.cs @@ -136,10 +136,6 @@ public void ProtocolHandlerMailbox_Test_ShallDrop() msg = Message.Create(MessageCommand.Inv, s); uut.ShallDrop(msg, emptyQueue).Should().Be(false); uut.ShallDrop(msg, new object[] { msg }).Should().Be(false); - // GetData (drop) - msg = Message.Create(MessageCommand.GetData, s); - uut.ShallDrop(msg, emptyQueue).Should().Be(false); - uut.ShallDrop(msg, new object[] { msg }).Should().Be(true); // NotFound (no drop) msg = Message.Create(MessageCommand.NotFound, s); uut.ShallDrop(msg, emptyQueue).Should().Be(false); diff --git a/neo/Network/P2P/ProtocolHandler.cs b/neo/Network/P2P/ProtocolHandler.cs index ea645b79db..f2262a2db4 100644 --- a/neo/Network/P2P/ProtocolHandler.cs +++ b/neo/Network/P2P/ProtocolHandler.cs @@ -329,7 +329,6 @@ internal protected override bool ShallDrop(object message, IEnumerable queue) { case MessageCommand.GetAddr: case MessageCommand.GetBlocks: - case MessageCommand.GetData: case MessageCommand.GetHeaders: case MessageCommand.Mempool: return queue.OfType().Any(p => p.Command == msg.Command);