mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
fetch dependencies when creating request simultaneously
This commit is contained in:
@@ -110,10 +110,14 @@ namespace BTCPayServer.Controllers
|
|||||||
entity.RedirectURL = invoice.RedirectURL ?? store.StoreWebsite;
|
entity.RedirectURL = invoice.RedirectURL ?? store.StoreWebsite;
|
||||||
entity.Status = "new";
|
entity.Status = "new";
|
||||||
entity.SpeedPolicy = ParseSpeedPolicy(invoice.TransactionSpeed, store.SpeedPolicy);
|
entity.SpeedPolicy = ParseSpeedPolicy(invoice.TransactionSpeed, store.SpeedPolicy);
|
||||||
entity.TxFee = store.GetStoreBlob(_Network).NetworkFeeDisabled ? Money.Zero : (await _FeeProvider.GetFeeRateAsync()).GetFee(100); // assume price for 100 bytes
|
|
||||||
entity.Rate = (double)await _RateProvider.GetRateAsync(invoice.Currency);
|
var getFeeRate = _FeeProvider.GetFeeRateAsync();
|
||||||
|
var getRate = _RateProvider.GetRateAsync(invoice.Currency);
|
||||||
|
var getAddress = _Wallet.ReserveAddressAsync(ParseDerivationStrategy(derivationStrategy));
|
||||||
|
entity.TxFee = store.GetStoreBlob(_Network).NetworkFeeDisabled ? Money.Zero : (await getFeeRate).GetFee(100); // assume price for 100 bytes
|
||||||
|
entity.Rate = (double)await getRate;
|
||||||
entity.PosData = invoice.PosData;
|
entity.PosData = invoice.PosData;
|
||||||
entity.DepositAddress = await _Wallet.ReserveAddressAsync(ParseDerivationStrategy(derivationStrategy));
|
entity.DepositAddress = await getAddress;
|
||||||
|
|
||||||
entity = await _InvoiceRepository.CreateInvoiceAsync(store.Id, entity);
|
entity = await _InvoiceRepository.CreateInvoiceAsync(store.Id, entity);
|
||||||
await _Watcher.WatchAsync(entity.Id);
|
await _Watcher.WatchAsync(entity.Id);
|
||||||
|
|||||||
Reference in New Issue
Block a user