Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ClassCastError in Portfolio History Summary Popup #5363

Merged
merged 1 commit into from Mar 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import bisq.core.monetary.Volume;
import bisq.core.offer.Offer;
import bisq.core.offer.OfferPayload;
import bisq.core.offer.OpenOffer;
import bisq.core.provider.price.MarketPrice;
import bisq.core.provider.price.PriceFeedService;
import bisq.core.trade.Tradable;
Expand Down Expand Up @@ -159,7 +160,7 @@ public Coin getTotalTxFee() {
return Coin.valueOf(getList().stream()
.map(ClosedTradableListItem::getTradable)
.mapToLong(tradable -> {
if (wasMyOffer(tradable)) {
if (wasMyOffer(tradable) || tradable instanceof OpenOffer) {
return tradable.getOffer().getTxFee().value;
} else {
// taker pays for 3 transactions
Expand All @@ -178,7 +179,7 @@ public Coin getTotalTradeFee(boolean expectBtcFee) {

protected long getTradeFee(Tradable tradable, boolean expectBtcFee) {
Offer offer = tradable.getOffer();
if (wasMyOffer(tradable)) {
if (wasMyOffer(tradable) || tradable instanceof OpenOffer) {
String makerFeeTxId = offer.getOfferFeePaymentTxId();
boolean notInBsqWallet = bsqWalletService.getTransaction(makerFeeTxId) == null;
if (expectBtcFee) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ boolean isCurrencyForTradeFeeBtc(ClosedTradableListItem item) {

Tradable tradable = item.getTradable();
Offer offer = tradable.getOffer();
if (wasMyOffer(tradable)) {
if (wasMyOffer(tradable) || tradable instanceof OpenOffer) {
// I was maker so we use offer
return offer.isCurrencyForMakerFeeBtc();
} else {
Expand Down