seller resets address entries on payout published

This commit is contained in:
woodser 2022-10-01 17:43:19 -04:00
parent 58aad5e6ae
commit 139896bced
2 changed files with 6 additions and 2 deletions

View file

@ -251,8 +251,9 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
xmrWalletService.getAddressEntriesForOpenOffer().stream()
.filter(e -> !openOffersIdSet.contains(e.getOfferId()))
.forEach(e -> {
log.warn("We found an outdated addressEntry for openOffer {} (openOffers does not contain that " +
log.warn("We found an outdated addressEntry with context {} for openOffer {} (openOffers does not contain that " +
"offer), offers.size={}",
e.getContext(),
e.getOfferId(), openOffers.size());
xmrWalletService.resetAddressEntriesForOpenOffer(e.getOfferId());
});
@ -579,7 +580,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
openOffers.remove(openOffer);
openOffer.setState(OpenOffer.State.CLOSED);
offerBookService.removeOffer(openOffer.getOffer().getOfferPayload(),
() -> log.trace("Successful removed offer"),
() -> log.info("Successfully removed offer {}", offer.getId()),
log::error);
requestPersistence();
});

View file

@ -41,6 +41,9 @@ public class SellerPreparePaymentReceivedMessage extends TradeTask {
if (trade.getPayoutTxHex() != null) {
log.info("Seller verifying, signing, and publishing payout tx");
trade.verifyPayoutTx(trade.getPayoutTxHex(), true, true);
// mark address entries as available
processModel.getXmrWalletService().resetAddressEntriesForPendingTrade(trade.getId());
} else {
// create unsigned payout tx