mirror of
https://github.com/gosticks/iota.flash.js-java-wrapper.git
synced 2025-10-16 11:45:40 +00:00
fixed balance calculation
This commit is contained in:
parent
e97a264294
commit
65ecdac160
@ -273,15 +273,11 @@ public class Main {
|
||||
}
|
||||
|
||||
public static double getBalanceOfUser(UserObject user) {
|
||||
double balance = 0.0;
|
||||
double balance = user.getFlash().getDeposits().get(user.getUserIndex());
|
||||
Map<String, Integer> transfers = user.getFlash().getOutputs();
|
||||
if (transfers.size() == 0) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
for (Map.Entry<String, Integer> transfer : transfers.entrySet()) {
|
||||
if (transfer.getKey().equals(user.getAddress())) {
|
||||
balance += transfer.getValue() / 2;
|
||||
balance += transfer.getValue();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user