Skip to content
Snippets Groups Projects
Commit cab5c42c authored by Luca Keidel's avatar Luca Keidel
Browse files

Fixed config loading and introduced remote addresses instead of local addresses

parent 4cb34ef9
No related branches found
No related tags found
1 merge request!3Preliminary result of the software
package fucoin;
import akka.actor.ActorRef;
import akka.actor.Address;
import akka.actor.UntypedActor;
import fucoin.wallet.AbstractWallet;
......@@ -20,7 +21,8 @@ public abstract class AbstractNode extends UntypedActor implements Serializable
}
public String getAddress(ActorRef self) {
return self.path().toSerializationFormatWithAddress(self.path().address());
Address remoteAddr = getContext().system().provider().getDefaultAddress();
return self.path().toStringWithAddress(remoteAddr);
}
/**
......@@ -66,13 +68,7 @@ public abstract class AbstractNode extends UntypedActor implements Serializable
}
public void log(String string) {
if (this instanceof AbstractWallet){
System.out.println("Yes: "+string);
((AbstractWallet) this).log(string);
}else{
System.out.println("No: "+this.getClass());
System.out.println(getSelf().path().name() + ": " + string);
}
System.out.println(getSelf().path().name() + ": " + string);
}
}
\ No newline at end of file
......@@ -30,7 +30,7 @@ public class Main {
Config config = ConfigFactory.parseFile(file);
if (!file.exists()) {
System.out.println("Load default application.conf");
config = ConfigFactory.parseResources("application.config");
config = ConfigFactory.parseResources("application.conf");
} else {
System.out.println("Load local application.conf");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment