Revert most changes with applying offerFilter. Leave it to @ghubstan to implement it.

This commit is contained in:
chimp1984 2021-01-05 10:19:21 -05:00
parent 58a1f9c402
commit db6722b335
No known key found for this signature in database
GPG key ID: 9801B4EC591F90E3
3 changed files with 2 additions and 10 deletions

View file

@ -202,7 +202,6 @@ public class CoreApi {
coreTradesService.takeOffer(offer,
paymentAccountId,
takerFeeCurrencyCode,
true,
resultHandler);
}

View file

@ -22,7 +22,6 @@ import bisq.core.monetary.Price;
import bisq.core.offer.CreateOfferService;
import bisq.core.offer.Offer;
import bisq.core.offer.OfferBookService;
import bisq.core.offer.OfferFilter;
import bisq.core.offer.OfferUtil;
import bisq.core.offer.OpenOfferManager;
import bisq.core.payment.PaymentAccount;
@ -59,27 +58,23 @@ class CoreOffersService {
private final OpenOfferManager openOfferManager;
private final OfferUtil offerUtil;
private final User user;
private final OfferFilter offerFilter;
@Inject
public CoreOffersService(CreateOfferService createOfferService,
OfferBookService offerBookService,
OpenOfferManager openOfferManager,
OfferUtil offerUtil,
User user,
OfferFilter offerFilter) {
User user) {
this.createOfferService = createOfferService;
this.offerBookService = offerBookService;
this.openOfferManager = openOfferManager;
this.offerUtil = offerUtil;
this.user = user;
this.offerFilter = offerFilter;
}
Offer getOffer(String id) {
return offerBookService.getOffers().stream()
.filter(o -> o.getId().equals(id))
.filter(o -> offerFilter.canTakeOffer(o, true).isValid())
.findAny().orElseThrow(() ->
new IllegalStateException(format("offer with id '%s' not found", id)));
}
@ -92,7 +87,6 @@ class CoreOffersService {
.equalsIgnoreCase(currencyCode);
return offerOfWantedDirection && offerInWantedCurrency;
})
.filter(offer -> offerFilter.canTakeOffer(offer, true).isValid())
.collect(Collectors.toList());
// A buyer probably wants to see sell orders in price ascending order.

View file

@ -82,7 +82,6 @@ class CoreTradesService {
void takeOffer(Offer offer,
String paymentAccountId,
String takerFeeCurrencyCode,
boolean isTakerApiUser,
Consumer<Trade> resultHandler) {
coreWalletsService.verifyWalletsAreAvailable();
coreWalletsService.verifyEncryptedWalletIsUnlocked();
@ -109,7 +108,7 @@ class CoreTradesService {
offer,
paymentAccountId,
useSavingsWallet,
isTakerApiUser,
true,
resultHandler::accept,
errorMessage -> {
log.error(errorMessage);