offer key images are null when not initialized

This commit is contained in:
woodser 2024-08-02 15:16:47 -04:00
parent d9630a13b5
commit dbb3d4f891
3 changed files with 6 additions and 7 deletions

View file

@ -390,6 +390,8 @@ public final class OfferPayload implements ProtectedStoragePayload, ExpirablePay
null : new ArrayList<>(proto.getAcceptedBankIdsList()); null : new ArrayList<>(proto.getAcceptedBankIdsList());
List<String> acceptedCountryCodes = proto.getAcceptedCountryCodesList().isEmpty() ? List<String> acceptedCountryCodes = proto.getAcceptedCountryCodesList().isEmpty() ?
null : new ArrayList<>(proto.getAcceptedCountryCodesList()); null : new ArrayList<>(proto.getAcceptedCountryCodesList());
List<String> reserveTxKeyImages = proto.getReserveTxKeyImagesList().isEmpty() ?
null : new ArrayList<>(proto.getReserveTxKeyImagesList());
String hashOfChallenge = ProtoUtil.stringOrNullFromProto(proto.getHashOfChallenge()); String hashOfChallenge = ProtoUtil.stringOrNullFromProto(proto.getHashOfChallenge());
Map<String, String> extraDataMapMap = CollectionUtils.isEmpty(proto.getExtraDataMap()) ? Map<String, String> extraDataMapMap = CollectionUtils.isEmpty(proto.getExtraDataMap()) ?
null : proto.getExtraDataMap(); null : proto.getExtraDataMap();
@ -431,7 +433,7 @@ public final class OfferPayload implements ProtectedStoragePayload, ExpirablePay
proto.getProtocolVersion(), proto.getProtocolVersion(),
proto.hasArbitratorSigner() ? NodeAddress.fromProto(proto.getArbitratorSigner()) : null, proto.hasArbitratorSigner() ? NodeAddress.fromProto(proto.getArbitratorSigner()) : null,
ProtoUtil.byteArrayOrNullFromProto(proto.getArbitratorSignature()), ProtoUtil.byteArrayOrNullFromProto(proto.getArbitratorSignature()),
proto.getReserveTxKeyImagesList() == null ? null : new ArrayList<String>(proto.getReserveTxKeyImagesList())); reserveTxKeyImages);
} }
@Override @Override

View file

@ -1754,7 +1754,7 @@ public class OpenOfferManager implements PeerManager.Listener, DecryptedDirectMe
log.warn("Offer {} has invalid arbitrator signature, reposting", openOffer.getId()); log.warn("Offer {} has invalid arbitrator signature, reposting", openOffer.getId());
isValid = false; isValid = false;
} }
if (openOffer.getOffer().getOfferPayload().getReserveTxKeyImages() != null && (openOffer.getReserveTxHash() == null || openOffer.getReserveTxHash().isEmpty())) { if ((openOffer.getOffer().getOfferPayload().getReserveTxKeyImages() != null || openOffer.getOffer().getOfferPayload().getReserveTxKeyImages().isEmpty()) && (openOffer.getReserveTxHash() == null || openOffer.getReserveTxHash().isEmpty())) {
log.warn("Offer {} is missing reserve tx hash but has reserved key images, reposting", openOffer.getId()); log.warn("Offer {} is missing reserve tx hash but has reserved key images, reposting", openOffer.getId());
isValid = false; isValid = false;
} }

View file

@ -102,11 +102,8 @@ public class MakerReserveOfferFunds extends Task<PlaceOfferModel> {
// reset state with wallet lock // reset state with wallet lock
model.getXmrWalletService().resetAddressEntriesForOpenOffer(offer.getId()); model.getXmrWalletService().resetAddressEntriesForOpenOffer(offer.getId());
if (reserveTx != null) { if (reserveTx != null) model.getXmrWalletService().thawOutputs(HavenoUtils.getInputKeyImages(reserveTx));
model.getXmrWalletService().thawOutputs(HavenoUtils.getInputKeyImages(reserveTx));
offer.getOfferPayload().setReserveTxKeyImages(null); offer.getOfferPayload().setReserveTxKeyImages(null);
}
throw e; throw e;
} }