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 {
@Override
protected void onAction(ActorRef sender, ActorRef self, UntypedActorContext context, SuperVisorImpl abstractNode) {
// //write the snapshot
// if (!abstractNode.writeSnapshot(time)) {
// //snapshot already exists
// return;
// }
//write the snapshot
if (!abstractNode.writeSnapshot(time)) {
//snapshot already exists
return;
}
//
// //notify one in the network
// for(ActorRef startPoint: abstractNode.getKnownNeighbors().values()) {
// startPoint.tell(new ActionWalletCreateSnapshot(time), self);
// break;
// }
}
}
......@@ -2,6 +2,7 @@ package fucoin.wallet;
import akka.actor.*;
import fucoin.actions.ClientAction;
import fucoin.actions.control.ActionSuperVisorCreateSnapshot;
import fucoin.actions.control.ActionWalletCreateSnapshot;
import fucoin.actions.join.ActionJoin;
import fucoin.actions.join.ActionTellSupervisor;
......@@ -307,6 +308,8 @@ public class WalletImpl extends AbstractWallet {
enableMessageForwarding(token, self());
getRemoteSuperVisorActor().tell(new ActionSuperVisorCreateSnapshot(token), self());
getKnownNeighbors().values().forEach(actorRef -> {
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