Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzhang committed Jun 5, 2020
1 parent dc53059 commit 2e0213a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/neo/Network/P2P/LocalNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ internal static IPEndPoint GetIpEndPoint(string hostAndPort)
/// <param name="node">Remote node</param>
public bool AllowNewConnection(IActorRef actor, RemoteNode node)
{
if (node.Version.Magic != ProtocolSettings.Default.Magic) return false;
if (node.Version.Nonce == Nonce) return false;

foreach (var other in RemoteNodes.Values)
Expand Down
2 changes: 1 addition & 1 deletion src/neo/Network/P2P/RemoteNode.ProtocolHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ private void OnVersionMessageReceived(VersionPayload payload)
break;
}
}
if (payload.Magic != ProtocolSettings.Default.Magic || !LocalNode.Singleton.AllowNewConnection(Self, this))
if (!LocalNode.Singleton.AllowNewConnection(Self, this))
{
Disconnect(true);
return;
Expand Down

0 comments on commit 2e0213a

Please sign in to comment.