mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-10-01 01:35:48 -04:00
check account open on create crypto payment account (#281)
This commit is contained in:
parent
5b38eab716
commit
272ae8bfa9
@ -48,17 +48,17 @@ import static java.lang.String.format;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
class CorePaymentAccountsService {
|
class CorePaymentAccountsService {
|
||||||
|
|
||||||
private final CoreWalletsService coreWalletsService;
|
private final CoreAccountService accountService;
|
||||||
private final AccountAgeWitnessService accountAgeWitnessService;
|
private final AccountAgeWitnessService accountAgeWitnessService;
|
||||||
private final PaymentAccountForm paymentAccountForm;
|
private final PaymentAccountForm paymentAccountForm;
|
||||||
private final User user;
|
private final User user;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public CorePaymentAccountsService(CoreWalletsService coreWalletsService,
|
public CorePaymentAccountsService(CoreAccountService accountService,
|
||||||
AccountAgeWitnessService accountAgeWitnessService,
|
AccountAgeWitnessService accountAgeWitnessService,
|
||||||
PaymentAccountForm paymentAccountForm,
|
PaymentAccountForm paymentAccountForm,
|
||||||
User user) {
|
User user) {
|
||||||
this.coreWalletsService = coreWalletsService;
|
this.accountService = accountService;
|
||||||
this.accountAgeWitnessService = accountAgeWitnessService;
|
this.accountAgeWitnessService = accountAgeWitnessService;
|
||||||
this.paymentAccountForm = paymentAccountForm;
|
this.paymentAccountForm = paymentAccountForm;
|
||||||
this.user = user;
|
this.user = user;
|
||||||
@ -104,6 +104,7 @@ class CorePaymentAccountsService {
|
|||||||
String currencyCode,
|
String currencyCode,
|
||||||
String address,
|
String address,
|
||||||
boolean tradeInstant) {
|
boolean tradeInstant) {
|
||||||
|
accountService.checkAccountOpen();
|
||||||
if (currencyCode == null) throw new RuntimeException("Cryptocurrency code is null");
|
if (currencyCode == null) throw new RuntimeException("Cryptocurrency code is null");
|
||||||
var cryptoCurrencyAccount = tradeInstant
|
var cryptoCurrencyAccount = tradeInstant
|
||||||
? (InstantCryptoCurrencyAccount) PaymentAccountFactory.getPaymentAccount(PaymentMethod.BLOCK_CHAINS_INSTANT)
|
? (InstantCryptoCurrencyAccount) PaymentAccountFactory.getPaymentAccount(PaymentMethod.BLOCK_CHAINS_INSTANT)
|
||||||
|
Loading…
Reference in New Issue
Block a user