mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-12-22 19:49:32 +00:00
fix reserved balance = frozen offer outputs + confirmed deposits
This commit is contained in:
parent
5ebafecd8f
commit
008210abf6
1 changed files with 8 additions and 0 deletions
|
@ -40,8 +40,10 @@ import javafx.collections.ListChangeListener;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import monero.common.MoneroError;
|
||||||
import monero.wallet.model.MoneroOutputQuery;
|
import monero.wallet.model.MoneroOutputQuery;
|
||||||
import monero.wallet.model.MoneroOutputWallet;
|
import monero.wallet.model.MoneroOutputWallet;
|
||||||
|
import monero.wallet.model.MoneroTxWallet;
|
||||||
import org.bitcoinj.core.Coin;
|
import org.bitcoinj.core.Coin;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@ -128,6 +130,12 @@ public class Balances {
|
||||||
Coin sum = Coin.valueOf(0);
|
Coin sum = Coin.valueOf(0);
|
||||||
List<Trade> openTrades = tradeManager.getTradesStreamWithFundsLockedIn().collect(Collectors.toList());
|
List<Trade> openTrades = tradeManager.getTradesStreamWithFundsLockedIn().collect(Collectors.toList());
|
||||||
for (Trade trade : openTrades) {
|
for (Trade trade : openTrades) {
|
||||||
|
try {
|
||||||
|
MoneroTxWallet depositTx = xmrWalletService.getWallet().getTx(trade.getSelf().getDepositTxHash());
|
||||||
|
if (!depositTx.isConfirmed()) continue; // outputs are frozen until confirmed by arbitrator's broadcast
|
||||||
|
} catch (MoneroError e) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (trade.getContract() == null) continue;
|
if (trade.getContract() == null) continue;
|
||||||
Long reservedAmt;
|
Long reservedAmt;
|
||||||
OfferPayload offerPayload = trade.getContract().getOfferPayload();
|
OfferPayload offerPayload = trade.getContract().getOfferPayload();
|
||||||
|
|
Loading…
Reference in a new issue