Skip to content
Snippets Groups Projects
ActionJoin.java 765 B
Newer Older
Michael Kmoch's avatar
Michael Kmoch committed
package fucoin.actions.join;

import akka.actor.ActorRef;
import akka.actor.UntypedActorContext;
import fucoin.AbstractNode;
import fucoin.actions.ClientAction;
import fucoin.wallet.AbstractWallet;
Michael Kmoch's avatar
Michael Kmoch committed

//Used to join the network (a pre known participant/WalletImpl must be known)
public class ActionJoin extends ClientAction {
Michael Kmoch's avatar
Michael Kmoch committed

    protected void onAction(ActorRef sender, ActorRef self, UntypedActorContext context, AbstractWallet node) {
        ActionJoinAnswer aja = new ActionJoinAnswer(node.getRemoteSuperVisorActor());
        aja.someNeighbors.putAll(node.getKnownNeighbors());
        System.out.println("Answer to " + sender.path().name());
        //node.addKnownNeighbor(sender.path().name(), sender);
Michael Kmoch's avatar
Michael Kmoch committed
}