Skip to content

Commit

Permalink
Fix payment request service wallet initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
everoddandeven committed Dec 29, 2024
1 parent 5aa72ce commit 3f5ab60
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.springframework.stereotype.Service;

import monero.ecwid.model.EcwidPaymentData;
import monero.ecwid.server.config.ServerConfig;
import monero.ecwid.server.error.PaymentRequestAlreadyExistsException;
import monero.ecwid.server.repository.MoneroTransactionEntity;
import monero.ecwid.server.repository.MoneroTransactionRepository;
Expand Down Expand Up @@ -37,10 +38,15 @@ public class PaymentRequestService {

public PaymentRequestService(PaymentRequestRepository repository, MoneroTransactionRepository transactionRepository) {
this.repository = repository;
this.wallet = WalletUtils.getWallet();
this.wallet = WalletUtils.getWallet(false);
this.walletListener = new WalletListener(this);
this.wallet.addListener(walletListener);
this.transactionRepository = transactionRepository;

Long restoreHeight = ServerConfig.getServerConfig().walletRestoreHeight;

this.wallet.sync(restoreHeight);
this.wallet.startSyncing();
}

public List<PaymentRequestEntity> getAll() {
Expand Down

0 comments on commit 3f5ab60

Please sign in to comment.