remove signed offers with common key images

This commit is contained in:
woodser 2023-09-04 11:08:37 -04:00
parent 9c2308f7a3
commit f78a9cd907

View File

@ -764,6 +764,13 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
private void addSignedOffer(SignedOffer signedOffer) {
log.info("Adding SignedOffer offer for offer {}", signedOffer.getOfferId());
synchronized (signedOffers) {
// remove signed offers with common key images
for (String keyImage : signedOffer.getReserveTxKeyImages()) {
removeSignedOffers(keyImage);
}
// add new signed offer
signedOffers.add(signedOffer);
signedOfferKeyImagePoller.addKeyImages(signedOffer.getReserveTxKeyImages());
}