Viacoin:[RPC] getCryptoAddress fix
This commit is contained in:
parent
3f5f0d7665
commit
ed72b2b849
|
@ -79,12 +79,17 @@ public class ViacoindRPCWallet implements IWallet{
|
||||||
log.error("Viacoind wallet error: unknown cryptocurrency.");
|
log.error("Viacoind wallet error: unknown cryptocurrency.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
double balance = getClient(rpcURL).getBalance(accountName);
|
List<String> addressesByAccount = getClient(rpcURL).getAddressesByAccount(accountName);
|
||||||
return new BigDecimal(balance);
|
if (addressesByAccount == null || addressesByAccount.size() == 0) {
|
||||||
|
return null;
|
||||||
|
}else{
|
||||||
|
return addressesByAccount.get(0);
|
||||||
|
}
|
||||||
} catch (BitcoinException e) {
|
} catch (BitcoinException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return null
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue