mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-14 09:25:37 -04:00
show reserved amount in maker's offer details
This commit is contained in:
parent
e63141279c
commit
94ab3c1f9b
6 changed files with 51 additions and 22 deletions
|
@ -82,6 +82,7 @@ import monero.common.TaskLooper;
|
|||
import monero.daemon.MoneroDaemonRpc;
|
||||
import monero.daemon.model.MoneroDaemonInfo;
|
||||
import monero.daemon.model.MoneroFeeEstimate;
|
||||
import monero.daemon.model.MoneroKeyImage;
|
||||
import monero.daemon.model.MoneroNetworkType;
|
||||
import monero.daemon.model.MoneroOutput;
|
||||
import monero.daemon.model.MoneroSubmitTxResult;
|
||||
|
@ -196,6 +197,7 @@ public class XmrWalletService {
|
|||
this.rpcBindPort = rpcBindPort;
|
||||
this.useNativeXmrWallet = useNativeXmrWallet;
|
||||
this.xmrWalletFile = new File(walletDir, MONERO_WALLET_NAME);
|
||||
HavenoUtils.xmrWalletService = this;
|
||||
|
||||
// set monero logging
|
||||
if (MONERO_LOG_LEVEL >= 0) MoneroUtils.setLogLevel(MONERO_LOG_LEVEL);
|
||||
|
@ -535,6 +537,15 @@ public class XmrWalletService {
|
|||
}
|
||||
}
|
||||
|
||||
public BigInteger getOutputsAmount(Collection<String> keyImages) {
|
||||
BigInteger sum = BigInteger.ZERO;
|
||||
for (String keyImage : keyImages) {
|
||||
List<MoneroOutputWallet> outputs = getOutputs(new MoneroOutputQuery().setIsSpent(false).setKeyImage(new MoneroKeyImage(keyImage)));
|
||||
if (!outputs.isEmpty()) sum = sum.add(outputs.get(0).getAmount());
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
private List<Integer> getSubaddressesWithExactInput(BigInteger amount) {
|
||||
|
||||
// fetch unspent, unfrozen, unlocked outputs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue