Skip to content

Commit

Permalink
Merge branch 'master' of github.com:snowblossomcoin/snowblossom
Browse files Browse the repository at this point in the history
  • Loading branch information
fireduck64 committed Jun 4, 2018
2 parents 0ef1a3e + 813981a commit 9f333a9
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 73 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,3 +1,4 @@
bazel-*
.metadata/
.project/.idea/workspace.xml
.project/
.project-data-dir/
2 changes: 1 addition & 1 deletion .project/.idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .project/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 12 additions & 7 deletions client/src/SnowBlossomClient.java
Expand Up @@ -39,7 +39,7 @@ public static void main(String args[]) throws Exception
}

ConfigFile config = new ConfigFile(args[0]);

LogSetup.setup(config);

SnowBlossomClient client = new SnowBlossomClient(config);
Expand Down Expand Up @@ -91,7 +91,7 @@ else if (command.equals("loadtest"))
{
client.runLoadTest();
}
else
else
{
logger.log(Level.SEVERE, String.format("Unknown command %s. Try 'send'", command));
System.exit(-1);
Expand All @@ -118,7 +118,7 @@ public SnowBlossomClient(Config config) throws Exception
params = NetworkParams.loadFromConfig(config);
int port = config.getIntWithDefault("node_port", params.getDefaultPort());


ManagedChannel channel = ManagedChannelBuilder.forAddress(host, port).usePlaintext(true).build();

asyncStub = UserServiceGrpc.newStub(channel);
Expand Down Expand Up @@ -215,6 +215,7 @@ public void showBalances()
long total_spendable = 0;
DecimalFormat df = new DecimalFormat("0.000000");

Throwable logException = null;
for(AddressSpec claim : wallet_database.getAddressesList())
{
AddressSpecHash hash = AddressUtil.getHashForSpec(claim);
Expand All @@ -228,7 +229,7 @@ public void showBalances()

for(TransactionBridge b : bridges)
{

if (b.unconfirmed)
{
if (!b.spent)
Expand All @@ -253,18 +254,24 @@ public void showBalances()

double val_conf_d = (double) value_confirmed / (double) Globals.SNOW_VALUE;
double val_unconf_d = (double) value_unconfirmed / (double) Globals.SNOW_VALUE;
System.out.println(String.format(" %s (%s pending) in %d outputs",
System.out.println(String.format(" %s (%s pending) in %d outputs",
df.format(val_conf_d), df.format(val_unconf_d), bridges.size()));

total_confirmed += value_confirmed;
total_unconfirmed += value_unconfirmed;
}
catch(Throwable e)
{
logException = e;
System.out.println(e);
}

}
if (logException != null)
{
System.out.println("Last exception stacktrace:");
logException.printStackTrace(System.out);
}
double total_conf_d = (double) total_confirmed / (double) Globals.SNOW_VALUE;
double total_unconf_d = (double) total_unconfirmed / (double) Globals.SNOW_VALUE;
double total_spend_d = (double) total_spendable / Globals.SNOW_VALUE_D;
Expand Down Expand Up @@ -453,8 +460,6 @@ public void runLoadTest()
{
return;
}

}

}
}

0 comments on commit 9f333a9

Please sign in to comment.