Skip to content
Snippets Groups Projects
ActionJoin.java 624 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;
Michael Kmoch's avatar
Michael Kmoch committed

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

    @Override
    protected void onAction(ActorRef sender, ActorRef self,
                            UntypedActorContext context, AbstractNode node) {
        ActionJoinAnswer aja = new ActionJoinAnswer();
        aja.someNeighbors.putAll(node.getKnownNeighbors());
        System.out.println("Answer to "+sender.path().name());