filePrefix = "regtest-";
}
final int port = Integer.parseInt(options.valueOf("port").toString());
WalletAppKit appkit = new WalletAppKit(params, new File("."), filePrefix + "payfile-server-" + port) {
@Override
protected void addWalletExtensions() throws Exception {
super.addWalletExtensions();
wallet().addExtension(new StoredPaymentChannelServerStates(wallet(), peerGroup()));
}
};
if (params == RegTestParams.get()) {
appkit.connectToLocalHost();
}
appkit.setUserAgent("PayFile Server", "1.0").startAndWait();
System.out.println(appkit.wallet().toString(false, true, true, appkit.chain()));
ServerSocket socket = new ServerSocket(port);
Socket clientSocket;
do {
clientSocket = socket.accept();
final Server server = new Server(appkit.wallet(), appkit.peerGroup(), clientSocket);
Thread clientThread = new Thread(server, clientSocket.toString());
clientThread.start();
} while (true);
}