aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/gnunet/voting/BallotTool.java
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2014-03-11 01:24:03 +0000
committerFlorian Dold <florian.dold@gmail.com>2014-03-11 01:24:03 +0000
commite2eecb019105d48e4afebe1bf57355b3450c8219 (patch)
tree74d8aee60cc6d336a3bb0445af8e091cc2351ecd /src/main/java/org/gnunet/voting/BallotTool.java
parent651cfb94264b0d12e8ed9afafab05f84d2201933 (diff)
downloadgnunet-java-e2eecb019105d48e4afebe1bf57355b3450c8219.tar.gz
gnunet-java-e2eecb019105d48e4afebe1bf57355b3450c8219.zip
- simplify request containers
- statistics bugs - fix missing annotation in consensus api - work on voting
Diffstat (limited to 'src/main/java/org/gnunet/voting/BallotTool.java')
-rw-r--r--src/main/java/org/gnunet/voting/BallotTool.java18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/main/java/org/gnunet/voting/BallotTool.java b/src/main/java/org/gnunet/voting/BallotTool.java
index c0767a4..d03e0ea 100644
--- a/src/main/java/org/gnunet/voting/BallotTool.java
+++ b/src/main/java/org/gnunet/voting/BallotTool.java
@@ -112,9 +112,9 @@ public class BallotTool extends Program {
112 112
113 @Argument( 113 @Argument(
114 shortname = "k", 114 shortname = "k",
115 longname = "request-key", 115 longname = "getRequestIdentifier-key",
116 action = ArgumentAction.SET, 116 action = ArgumentAction.SET,
117 description = "request the threshold public key from authorities") 117 description = "getRequestIdentifier the threshold public key from authorities")
118 boolean requestKey = false; 118 boolean requestKey = false;
119 119
120 @Argument( 120 @Argument(
@@ -348,7 +348,8 @@ public class BallotTool extends Program {
348 } 348 }
349 ThresholdPublicKey thresholdPublicKey = ballot.getMajorityThresholdPublicKey(); 349 ThresholdPublicKey thresholdPublicKey = ballot.getMajorityThresholdPublicKey();
350 if (null == thresholdPublicKey) { 350 if (null == thresholdPublicKey) {
351 System.err.println("no threshold public key in ballot"); 351 System.err.println(String.format("no majority threshold public key in ballot (got keys of %s authorities)",
352 (ballot.thresholdPublicKeys == null) ? 0 : ballot.thresholdPublicKeys.size()));
352 setReturnValue(1); 353 setReturnValue(1);
353 return; 354 return;
354 } 355 }
@@ -364,7 +365,7 @@ public class BallotTool extends Program {
364 } 365 }
365 Random r = new Random(); 366 Random r = new Random();
366 PeerIdentity authority = remainingAuthorities.get(r.nextInt(remainingAuthorities.size())); 367 PeerIdentity authority = remainingAuthorities.get(r.nextInt(remainingAuthorities.size()));
367 System.out.println("submitting to authority" + authority.toString()); 368 System.out.println("submitting to authority " + authority.toString());
368 currentAuthority = authority; 369 currentAuthority = authority;
369 mesh = new Mesh(cfg, new BallotTunnelEndHandler(), new SubmitReceiver()); 370 mesh = new Mesh(cfg, new BallotTunnelEndHandler(), new SubmitReceiver());
370 tunnel = mesh.createTunnel(authority, TallyAuthorityDaemon.MESH_PORT, true, true, null); 371 tunnel = mesh.createTunnel(authority, TallyAuthorityDaemon.MESH_PORT, true, true, null);
@@ -471,14 +472,9 @@ public class BallotTool extends Program {
471 doCommands(); 472 doCommands();
472 } 473 }
473 } 474 }
474
475 private BallotTool(String[] args) {
476 super(args);
477 }
478
479 public static void main(String args[]) { 475 public static void main(String args[]) {
480 Program tool = new BallotTool(args); 476 Program tool = new BallotTool();
481 int ret = tool.start(); 477 int ret = tool.start(args);
482 System.exit(ret); 478 System.exit(ret);
483 } 479 }
484} 480}