Skip to content

Commit

Permalink
removed parameter from RemoteNode
Browse files Browse the repository at this point in the history
  • Loading branch information
igormcoelho committed Jul 1, 2019
1 parent 3f3e38b commit 1799197
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions neo.UnitTests/UT_RemoteNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public void RemoteNode_Test_Abort_DifferentMagic()
{
var testProbe = CreateTestProbe();
var connectionTestProbe = CreateTestProbe();
var protocolActor = ActorOfAsTestActorRef<ProtocolHandler>(() => new ProtocolHandler(testBlockchain));
var remoteNodeActor = ActorOfAsTestActorRef<RemoteNode>(() => new RemoteNode(testBlockchain, connectionTestProbe, null, null, protocolActor));
//var protocolActor = ActorOfAsTestActorRef<ProtocolHandler>(() => new ProtocolHandler(testBlockchain));
var remoteNodeActor = ActorOfAsTestActorRef<RemoteNode>(() => new RemoteNode(testBlockchain, connectionTestProbe, null, null));

connectionTestProbe.ExpectMsg<Tcp.Write>();

Expand All @@ -59,8 +59,8 @@ public void RemoteNode_Test_Accept_IfSameMagic()
{
var testProbe = CreateTestProbe();
var connectionTestProbe = CreateTestProbe();
var protocolActor = ActorOfAsTestActorRef<ProtocolHandler>(() => new ProtocolHandler(testBlockchain));
var remoteNodeActor = ActorOfAsTestActorRef<RemoteNode>(() => new RemoteNode(testBlockchain, connectionTestProbe, null, null, protocolActor));
//var protocolActor = ActorOfAsTestActorRef<ProtocolHandler>(() => new ProtocolHandler(testBlockchain));
var remoteNodeActor = ActorOfAsTestActorRef<RemoteNode>(() => new RemoteNode(testBlockchain, connectionTestProbe, null, null));

connectionTestProbe.ExpectMsg<Tcp.Write>();

Expand Down
7 changes: 3 additions & 4 deletions neo/Network/P2P/RemoteNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ internal class Relay { public IInventory Inventory; }
public uint LastBlockIndex { get; private set; } = 0;
public bool IsFullNode { get; private set; } = false;

public RemoteNode(NeoSystem system, object connection, IPEndPoint remote, IPEndPoint local, IActorRef protocolHandler)
public RemoteNode(NeoSystem system, object connection, IPEndPoint remote, IPEndPoint local)
: base(connection, remote, local)
{
this.system = system;
this.protocol = protocolHandler;
this.protocol = system.ActorSystem.ActorOf(ProtocolHandler.Props(system));
LocalNode.Singleton.RemoteNodes.TryAdd(Self, this);

var capabilities = new List<NodeCapability>
Expand Down Expand Up @@ -224,8 +224,7 @@ protected override void PostStop()

internal static Props Props(NeoSystem system, object connection, IPEndPoint remote, IPEndPoint local)
{
var protocol = system.ActorSystem.ActorOf(ProtocolHandler.Props(system));
return Akka.Actor.Props.Create(() => new RemoteNode(system, connection, remote, local, protocol)).WithMailbox("remote-node-mailbox");
return Akka.Actor.Props.Create(() => new RemoteNode(system, connection, remote, local)).WithMailbox("remote-node-mailbox");
}

private void SendMessage(Message message)
Expand Down

0 comments on commit 1799197

Please sign in to comment.