log cleanup

This commit is contained in:
woodser 2024-05-03 14:58:31 -04:00
parent f53a4e5fad
commit b50238a805
2 changed files with 5 additions and 2 deletions

View file

@ -1027,7 +1027,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
// handle sufficient available balance to split output // handle sufficient available balance to split output
boolean sufficientAvailableBalance = xmrWalletService.getAvailableBalance().compareTo(offerReserveAmount) >= 0; boolean sufficientAvailableBalance = xmrWalletService.getAvailableBalance().compareTo(offerReserveAmount) >= 0;
if (sufficientAvailableBalance) { if (sufficientAvailableBalance) {
log.info("Splitting and scheduling outputs for offer {} at subaddress {}", openOffer.getShortId()); log.info("Splitting and scheduling outputs for offer {}", openOffer.getShortId());
splitAndSchedule(openOffer); splitAndSchedule(openOffer);
} else if (openOffer.getScheduledTxHashes() == null) { } else if (openOffer.getScheduledTxHashes() == null) {
scheduleWithEarliestTxs(openOffers, openOffer); scheduleWithEarliestTxs(openOffers, openOffer);
@ -1040,10 +1040,10 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
MoneroTxWallet splitOutputTx = null; MoneroTxWallet splitOutputTx = null;
synchronized (XmrWalletService.WALLET_LOCK) { synchronized (XmrWalletService.WALLET_LOCK) {
XmrAddressEntry entry = xmrWalletService.getOrCreateAddressEntry(openOffer.getId(), XmrAddressEntry.Context.OFFER_FUNDING); XmrAddressEntry entry = xmrWalletService.getOrCreateAddressEntry(openOffer.getId(), XmrAddressEntry.Context.OFFER_FUNDING);
log.info("Creating split output tx to fund offer {} at subaddress {}", openOffer.getShortId(), entry.getSubaddressIndex());
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
for (int i = 0; i < TradeProtocol.MAX_ATTEMPTS; i++) { for (int i = 0; i < TradeProtocol.MAX_ATTEMPTS; i++) {
try { try {
log.info("Creating split output tx to fund offer {} at subaddress {}", openOffer.getShortId(), entry.getSubaddressIndex());
splitOutputTx = xmrWalletService.createTx(new MoneroTxConfig() splitOutputTx = xmrWalletService.createTx(new MoneroTxConfig()
.setAccountIndex(0) .setAccountIndex(0)
.setAddress(entry.getAddressString()) .setAddress(entry.getAddressString())

View file

@ -261,11 +261,14 @@ public class WithdrawalView extends ActivatableView<VBox, Void> {
// create tx // create tx
if (amount.compareTo(BigInteger.ZERO) <= 0) throw new RuntimeException(Res.get("portfolio.pending.step5_buyer.amountTooLow")); if (amount.compareTo(BigInteger.ZERO) <= 0) throw new RuntimeException(Res.get("portfolio.pending.step5_buyer.amountTooLow"));
log.info("Creating withdraw tx");
long startTime = System.currentTimeMillis();
MoneroTxWallet tx = xmrWalletService.createTx(new MoneroTxConfig() MoneroTxWallet tx = xmrWalletService.createTx(new MoneroTxConfig()
.setAccountIndex(0) .setAccountIndex(0)
.setAmount(amount) .setAmount(amount)
.setAddress(withdrawToAddress) .setAddress(withdrawToAddress)
.setSubtractFeeFrom(feeExcluded ? null : Arrays.asList(0))); .setSubtractFeeFrom(feeExcluded ? null : Arrays.asList(0)));
log.info("Done creating withdraw tx in {} ms", System.currentTimeMillis() - startTime);
// create confirmation message // create confirmation message
BigInteger receiverAmount = tx.getOutgoingTransfer().getDestinations().get(0).getAmount(); BigInteger receiverAmount = tx.getOutgoingTransfer().getDestinations().get(0).getAmount();