Skip to content

Commit

Permalink
Add null check at getMyTradeLimit
Browse files Browse the repository at this point in the history
Other small changes:
- Remove final from User as http-api branch will require to extend it.
- Add comment
  • Loading branch information
ManfredKarrer committed Jan 6, 2019
1 parent dbc028e commit 578c56c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ protected void run() {
"maxTradePeriod must be positive. maxTradePeriod=" + offer.getMaxTradePeriod());
// TODO check upper and lower bounds for fiat
// TODO check rest of new parameters
// TODO check for account age witness base tradeLimit is missing

complete();
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,14 @@ public long getMyAccountAge(PaymentAccountPayload paymentAccountPayload) {
}

public long getMyTradeLimit(PaymentAccount paymentAccount, String currencyCode) {
final Optional<AccountAgeWitness> witnessOptional = Optional.of(getMyWitness(paymentAccount.getPaymentAccountPayload()));
return getTradeLimit(paymentAccount.getPaymentMethod()
.getMaxTradeLimitAsCoin(currencyCode), currencyCode, witnessOptional, new Date());
if (paymentAccount == null)
return 0;

Optional<AccountAgeWitness> witnessOptional = Optional.of(getMyWitness(paymentAccount.getPaymentAccountPayload()));
return getTradeLimit(paymentAccount.getPaymentMethod().getMaxTradeLimitAsCoin(currencyCode),
currencyCode,
witnessOptional,
new Date());
}


Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/bisq/core/user/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
*/
@Slf4j
@AllArgsConstructor
public final class User implements PersistedDataHost {
public class User implements PersistedDataHost {
final private Storage<UserPayload> storage;
final private KeyRing keyRing;

Expand Down

0 comments on commit 578c56c

Please sign in to comment.