From 272ae8bfa933ed4ad6b93da7194b57262ea7b3d3 Mon Sep 17 00:00:00 2001 From: woodser Date: Tue, 12 Apr 2022 07:49:40 -0400 Subject: [PATCH] check account open on create crypto payment account (#281) --- .../java/bisq/core/api/CorePaymentAccountsService.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/bisq/core/api/CorePaymentAccountsService.java b/core/src/main/java/bisq/core/api/CorePaymentAccountsService.java index f06c2aef..a9c9d44c 100644 --- a/core/src/main/java/bisq/core/api/CorePaymentAccountsService.java +++ b/core/src/main/java/bisq/core/api/CorePaymentAccountsService.java @@ -48,17 +48,17 @@ import static java.lang.String.format; @Slf4j class CorePaymentAccountsService { - private final CoreWalletsService coreWalletsService; + private final CoreAccountService accountService; private final AccountAgeWitnessService accountAgeWitnessService; private final PaymentAccountForm paymentAccountForm; private final User user; @Inject - public CorePaymentAccountsService(CoreWalletsService coreWalletsService, + public CorePaymentAccountsService(CoreAccountService accountService, AccountAgeWitnessService accountAgeWitnessService, PaymentAccountForm paymentAccountForm, User user) { - this.coreWalletsService = coreWalletsService; + this.accountService = accountService; this.accountAgeWitnessService = accountAgeWitnessService; this.paymentAccountForm = paymentAccountForm; this.user = user; @@ -104,6 +104,7 @@ class CorePaymentAccountsService { String currencyCode, String address, boolean tradeInstant) { + accountService.checkAccountOpen(); if (currencyCode == null) throw new RuntimeException("Cryptocurrency code is null"); var cryptoCurrencyAccount = tradeInstant ? (InstantCryptoCurrencyAccount) PaymentAccountFactory.getPaymentAccount(PaymentMethod.BLOCK_CHAINS_INSTANT)