Viacoin:[RPC] getCryptoAddress fix

This commit is contained in:
romanornr 2017-11-18 23:47:45 +01:00
parent 3f5f0d7665
commit ed72b2b849
No known key found for this signature in database
GPG Key ID: 3F92368F0D21A206
1 changed files with 12 additions and 7 deletions

View File

@ -79,12 +79,17 @@ public class ViacoindRPCWallet implements IWallet{
log.error("Viacoind wallet error: unknown cryptocurrency.");
return null;
}
try {
double balance = getClient(rpcURL).getBalance(accountName);
return new BigDecimal(balance);
List<String> addressesByAccount = getClient(rpcURL).getAddressesByAccount(accountName);
if (addressesByAccount == null || addressesByAccount.size() == 0) {
return null;
}else{
return addressesByAccount.get(0);
}
} catch (BitcoinException e) {
e.printStackTrace();
return null
return null;
}
}