Skip to content
Snippets Groups Projects
Commit f317420a authored by Simon Könnecke's avatar Simon Könnecke
Browse files

snapshot trigger on wallet gui will be create as wall a supervisor snapshot

parent 5a00d926
No related tags found
No related merge requests found
...@@ -19,16 +19,17 @@ public class ActionSuperVisorCreateSnapshot extends SuperVisorAction { ...@@ -19,16 +19,17 @@ public class ActionSuperVisorCreateSnapshot extends SuperVisorAction {
@Override @Override
protected void onAction(ActorRef sender, ActorRef self, UntypedActorContext context, SuperVisorImpl abstractNode) { protected void onAction(ActorRef sender, ActorRef self, UntypedActorContext context, SuperVisorImpl abstractNode) {
// //write the snapshot //write the snapshot
// if (!abstractNode.writeSnapshot(time)) { if (!abstractNode.writeSnapshot(time)) {
// //snapshot already exists //snapshot already exists
// return; return;
// } }
// //
// //notify one in the network // //notify one in the network
// for(ActorRef startPoint: abstractNode.getKnownNeighbors().values()) { // for(ActorRef startPoint: abstractNode.getKnownNeighbors().values()) {
// startPoint.tell(new ActionWalletCreateSnapshot(time), self); // startPoint.tell(new ActionWalletCreateSnapshot(time), self);
// break; // break;
// } // }
} }
} }
...@@ -2,6 +2,7 @@ package fucoin.wallet; ...@@ -2,6 +2,7 @@ package fucoin.wallet;
import akka.actor.*; import akka.actor.*;
import fucoin.actions.ClientAction; import fucoin.actions.ClientAction;
import fucoin.actions.control.ActionSuperVisorCreateSnapshot;
import fucoin.actions.control.ActionWalletCreateSnapshot; import fucoin.actions.control.ActionWalletCreateSnapshot;
import fucoin.actions.join.ActionJoin; import fucoin.actions.join.ActionJoin;
import fucoin.actions.join.ActionTellSupervisor; import fucoin.actions.join.ActionTellSupervisor;
...@@ -307,6 +308,8 @@ public class WalletImpl extends AbstractWallet { ...@@ -307,6 +308,8 @@ public class WalletImpl extends AbstractWallet {
enableMessageForwarding(token, self()); enableMessageForwarding(token, self());
getRemoteSuperVisorActor().tell(new ActionSuperVisorCreateSnapshot(token), self());
getKnownNeighbors().values().forEach(actorRef -> { getKnownNeighbors().values().forEach(actorRef -> {
actorRef.tell(new ActionWalletCreateSnapshot(token, self()), self()); actorRef.tell(new ActionWalletCreateSnapshot(token, self()), self());
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment