Add more logs

This commit is contained in:
Manfred Karrer 2018-12-10 14:33:01 +01:00
parent f3efe505bf
commit 57f66f35a3
No known key found for this signature in database
GPG Key ID: 401250966A6B2C46
4 changed files with 9 additions and 5 deletions

View File

@ -591,7 +591,7 @@ public class BisqSetup {
tradeManager.getAddressEntriesForAvailableBalanceStream()
.filter(addressEntry -> addressEntry.getOfferId() != null)
.forEach(addressEntry -> {
log.debug("swapPendingOfferFundingEntries, offerId={}, OFFER_FUNDING", addressEntry.getOfferId());
log.warn("Swapping pending OFFER_FUNDING entries at startup. offerId={}", addressEntry.getOfferId());
btcWalletService.swapTradeEntryToAvailableEntry(addressEntry.getOfferId(), AddressEntry.Context.OFFER_FUNDING);
});

View File

@ -656,6 +656,7 @@ public class BtcWalletService extends WalletService {
}
public void resetAddressEntriesForOpenOffer(String offerId) {
log.info("resetAddressEntriesForOpenOffer offerId={}", offerId);
swapTradeEntryToAvailableEntry(offerId, AddressEntry.Context.OFFER_FUNDING);
swapTradeEntryToAvailableEntry(offerId, AddressEntry.Context.RESERVED_FOR_TRADE);
}

View File

@ -177,11 +177,13 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
}
private void cleanUpAddressEntries() {
Set<String> openTradesIdSet = openOffers.getList().stream().map(OpenOffer::getId).collect(Collectors.toSet());
Set<String> openOffersIdSet = openOffers.getList().stream().map(OpenOffer::getId).collect(Collectors.toSet());
btcWalletService.getAddressEntriesForOpenOffer().stream()
.filter(e -> !openTradesIdSet.contains(e.getOfferId()))
.filter(e -> !openOffersIdSet.contains(e.getOfferId()))
.forEach(e -> {
log.warn("We found an outdated addressEntry for openOffer {}", e.getOfferId());
log.warn("We found an outdated addressEntry for openOffer {} (openOffers does not contain that " +
"offer), offers.size={}",
e.getOfferId(), openOffers.size());
btcWalletService.resetAddressEntriesForOpenOffer(e.getOfferId());
});
}
@ -483,7 +485,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
openOffer.setState(OpenOffer.State.CANCELED);
openOffers.remove(openOffer);
closedTradableManager.add(openOffer);
log.debug("removeOpenOffer, offerId={}", offer.getId());
log.info("onRemoved offerId={}", offer.getId());
btcWalletService.resetAddressEntriesForOpenOffer(offer.getId());
resultHandler.handleResult();
}

View File

@ -114,6 +114,7 @@ public class MakerSetupDepositTxListener extends TradeTask {
}
private void swapReservedForTradeEntry() {
log.info("swapReservedForTradeEntry");
processModel.getBtcWalletService().swapTradeEntryToAvailableEntry(trade.getId(), AddressEntry.Context.RESERVED_FOR_TRADE);
}