Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
987d09041d | |||
df52d01a1d | |||
07de4af581 | |||
95c50dcc0d | |||
71a192d0ba | |||
83dd80ae86 | |||
ccfa85b5e0 | |||
e59821caa1 | |||
2215e5e069 | |||
48b2e682bf | |||
5750da574a | |||
b40095f603 | |||
ec11585223 |
@ -1,9 +1,8 @@
|
||||
using System.Reflection;
|
||||
using BTCPayServer.Abstractions.Contracts;
|
||||
using BTCPayServer.Abstractions.Models;
|
||||
using BTCPayServer.Plugins.Test.Migrations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Design;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace BTCPayServer.Plugins.Test
|
||||
{
|
||||
|
@ -63,4 +63,8 @@ The `./docker-lightning-channel-teardown.sh` script closes any existing lightnin
|
||||
2. Run `docker-compose pull` (this will ensure you have the lastest images)
|
||||
3. Run again with `docker-compose up dev`
|
||||
|
||||
How to run the Altcoin environment?
|
||||
|
||||
`docker-compose -f docker-compose.altcoins.yml up dev`
|
||||
|
||||
If you still have issues, try to restart docker.
|
||||
|
@ -75,9 +75,14 @@ namespace BTCPayServer.Controllers
|
||||
{
|
||||
var network = NetworkProvider.GetNetwork<BTCPayNetwork>(walletId.CryptoCode);
|
||||
vm.CryptoCode = network.CryptoCode;
|
||||
|
||||
var derivationSchemeSettings = GetDerivationSchemeSettings(walletId);
|
||||
if (derivationSchemeSettings == null)
|
||||
return NotFound();
|
||||
|
||||
vm.NBXSeedAvailable = await CanUseHotWallet() && !string.IsNullOrEmpty(await ExplorerClientProvider.GetExplorerClient(network)
|
||||
.GetMetadataAsync<string>(GetDerivationSchemeSettings(walletId).AccountDerivation,
|
||||
WellknownMetadataKeys.Mnemonic));
|
||||
.GetMetadataAsync<string>(derivationSchemeSettings.AccountDerivation, WellknownMetadataKeys.Mnemonic));
|
||||
|
||||
if (await vm.GetPSBT(network.NBitcoinNetwork) is PSBT psbt)
|
||||
{
|
||||
vm.Decoded = psbt.ToString();
|
||||
@ -98,9 +103,13 @@ namespace BTCPayServer.Controllers
|
||||
return await WalletPSBT(walletId, vm);
|
||||
var network = NetworkProvider.GetNetwork<BTCPayNetwork>(walletId.CryptoCode);
|
||||
vm.CryptoCode = network.CryptoCode;
|
||||
|
||||
var derivationSchemeSettings = GetDerivationSchemeSettings(walletId);
|
||||
if (derivationSchemeSettings == null)
|
||||
return NotFound();
|
||||
|
||||
vm.NBXSeedAvailable = await CanUseHotWallet() && !string.IsNullOrEmpty(await ExplorerClientProvider.GetExplorerClient(network)
|
||||
.GetMetadataAsync<string>(GetDerivationSchemeSettings(walletId).AccountDerivation,
|
||||
WellknownMetadataKeys.Mnemonic));
|
||||
.GetMetadataAsync<string>(derivationSchemeSettings.AccountDerivation, WellknownMetadataKeys.Mnemonic));
|
||||
var psbt = await vm.GetPSBT(network.NBitcoinNetwork);
|
||||
if (psbt == null)
|
||||
{
|
||||
@ -127,7 +136,6 @@ namespace BTCPayServer.Controllers
|
||||
return View(vm);
|
||||
|
||||
case "update":
|
||||
var derivationSchemeSettings = GetDerivationSchemeSettings(walletId);
|
||||
psbt = await ExplorerClientProvider.UpdatePSBT(derivationSchemeSettings, psbt);
|
||||
if (psbt == null)
|
||||
{
|
||||
|
@ -27,7 +27,10 @@ namespace BTCPayServer.Controllers
|
||||
public IActionResult NewPullPayment([ModelBinder(typeof(WalletIdModelBinder))]
|
||||
WalletId walletId)
|
||||
{
|
||||
return View(new NewPullPaymentModel()
|
||||
if (GetDerivationSchemeSettings(walletId) == null)
|
||||
return NotFound();
|
||||
|
||||
return View(new NewPullPaymentModel
|
||||
{
|
||||
Name = "",
|
||||
Currency = "BTC",
|
||||
@ -41,6 +44,9 @@ namespace BTCPayServer.Controllers
|
||||
public async Task<IActionResult> NewPullPayment([ModelBinder(typeof(WalletIdModelBinder))]
|
||||
WalletId walletId, NewPullPaymentModel model)
|
||||
{
|
||||
if (GetDerivationSchemeSettings(walletId) == null)
|
||||
return NotFound();
|
||||
|
||||
model.Name ??= string.Empty;
|
||||
model.Currency = model.Currency.ToUpperInvariant().Trim();
|
||||
if (_currencyTable.GetCurrencyData(model.Currency, false) is null)
|
||||
@ -99,7 +105,10 @@ namespace BTCPayServer.Controllers
|
||||
.Where(p => p.State == PayoutState.Completed || p.State == PayoutState.InProgress)
|
||||
})
|
||||
.ToListAsync();
|
||||
var vm = new PullPaymentsModel();
|
||||
|
||||
var vm = new PullPaymentsModel
|
||||
{ HasDerivationSchemeSettings = GetDerivationSchemeSettings(walletId) != null };
|
||||
|
||||
foreach (var o in pps)
|
||||
{
|
||||
var pp = o.PullPayment;
|
||||
@ -175,8 +184,9 @@ namespace BTCPayServer.Controllers
|
||||
[ModelBinder(typeof(WalletIdModelBinder))]
|
||||
WalletId walletId, PayoutsModel vm, CancellationToken cancellationToken)
|
||||
{
|
||||
if (vm is null)
|
||||
if (vm is null || GetDerivationSchemeSettings(walletId) == null)
|
||||
return NotFound();
|
||||
|
||||
var storeId = walletId.StoreId;
|
||||
var paymentMethodId = new PaymentMethodId(walletId.CryptoCode, PaymentTypes.BTCLike);
|
||||
var payoutIds = vm.WaitingForApproval.Where(p => p.Selected).Select(p => p.PayoutId).ToArray();
|
||||
|
@ -149,7 +149,7 @@ namespace BTCPayServer.Hosting
|
||||
: Path.Combine(datadirs.Value.DataDir, sqliteFileName));
|
||||
|
||||
options.DatabaseType = DatabaseType.Sqlite;
|
||||
options.ConnectionString = sqliteFileName;
|
||||
options.ConnectionString = connStr;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -28,6 +28,8 @@ namespace BTCPayServer.Models.WalletViewModels
|
||||
}
|
||||
|
||||
public List<PullPaymentModel> PullPayments { get; set; } = new List<PullPaymentModel>();
|
||||
|
||||
public bool HasDerivationSchemeSettings { get; set; }
|
||||
}
|
||||
|
||||
public class NewPullPaymentModel
|
||||
|
@ -413,7 +413,7 @@ namespace BTCPayServer.Services.Invoices
|
||||
{
|
||||
using (var context = _ContextFactory.CreateContext())
|
||||
{
|
||||
var invoiceData = await GetInvoiceRaw(invoiceId);
|
||||
var invoiceData = await GetInvoiceRaw(invoiceId, context);
|
||||
if (invoiceData == null || (storeId != null &&
|
||||
!invoiceData.StoreDataId.Equals(storeId,
|
||||
StringComparison.InvariantCultureIgnoreCase)))
|
||||
@ -429,7 +429,7 @@ namespace BTCPayServer.Services.Invoices
|
||||
{
|
||||
using (var context = _ContextFactory.CreateContext())
|
||||
{
|
||||
var invoiceData = await GetInvoiceRaw(invoiceId);
|
||||
var invoiceData = await GetInvoiceRaw(invoiceId, context);
|
||||
if (invoiceData == null)
|
||||
{
|
||||
return false;
|
||||
@ -472,8 +472,11 @@ namespace BTCPayServer.Services.Invoices
|
||||
|
||||
public async Task<InvoiceEntity> GetInvoice(string id, bool inludeAddressData = false)
|
||||
{
|
||||
var res = await GetInvoiceRaw(id, inludeAddressData);
|
||||
return res == null ? null : ToEntity(res);
|
||||
using (var context = _ContextFactory.CreateContext())
|
||||
{
|
||||
var res = await GetInvoiceRaw(id, context, inludeAddressData);
|
||||
return res == null ? null : ToEntity(res);
|
||||
}
|
||||
}
|
||||
public async Task<InvoiceEntity[]> GetInvoices(string[] invoiceIds)
|
||||
{
|
||||
@ -490,24 +493,21 @@ namespace BTCPayServer.Services.Invoices
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<InvoiceData> GetInvoiceRaw(string id, bool inludeAddressData = false)
|
||||
private async Task<InvoiceData> GetInvoiceRaw(string id, ApplicationDbContext dbContext, bool inludeAddressData = false)
|
||||
{
|
||||
using (var context = _ContextFactory.CreateContext())
|
||||
{
|
||||
IQueryable<Data.InvoiceData> query =
|
||||
context
|
||||
IQueryable<Data.InvoiceData> query =
|
||||
dbContext
|
||||
.Invoices
|
||||
.Include(o => o.Payments);
|
||||
if (inludeAddressData)
|
||||
query = query.Include(o => o.HistoricalAddressInvoices).Include(o => o.AddressInvoices);
|
||||
query = query.Where(i => i.Id == id);
|
||||
if (inludeAddressData)
|
||||
query = query.Include(o => o.HistoricalAddressInvoices).Include(o => o.AddressInvoices);
|
||||
query = query.Where(i => i.Id == id);
|
||||
|
||||
var invoice = (await query.ToListAsync()).FirstOrDefault();
|
||||
if (invoice == null)
|
||||
return null;
|
||||
var invoice = (await query.ToListAsync()).FirstOrDefault();
|
||||
if (invoice == null)
|
||||
return null;
|
||||
|
||||
return invoice;
|
||||
}
|
||||
return invoice;
|
||||
}
|
||||
|
||||
private InvoiceEntity ToEntity(Data.InvoiceData invoice)
|
||||
|
@ -18,14 +18,17 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="row button-row">
|
||||
<div class="col-lg-12">
|
||||
<a asp-action="NewPullPayment"
|
||||
asp-route-walletId="@this.Context.GetRouteValue("walletId")"
|
||||
class="btn btn-primary" role="button" id="NewPullPayment"><span class="fa fa-plus"></span> Create a new pull payment</a>
|
||||
<a href="https://docs.btcpayserver.org/PullPayments/" target="_blank"><span class="fa fa-question-circle-o" title="More information..."></span></a>
|
||||
@if (Model.HasDerivationSchemeSettings)
|
||||
{
|
||||
<div class="row button-row">
|
||||
<div class="col-lg-12">
|
||||
<a asp-action="NewPullPayment"
|
||||
asp-route-walletId="@Context.GetRouteValue("walletId")"
|
||||
class="btn btn-primary" role="button" id="NewPullPayment"><span class="fa fa-plus"></span> Create a new pull payment</a>
|
||||
<a href="https://docs.btcpayserver.org/PullPayments/" target="_blank"><span class="fa fa-question-circle-o" title="More information..."></span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="row">
|
||||
@foreach (var pp in Model.PullPayments)
|
||||
|
@ -1,5 +1,5 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Version>1.0.6.5</Version>
|
||||
<Version>1.0.6.7</Version>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
14
Changelog.md
14
Changelog.md
@ -1,5 +1,17 @@
|
||||
# Changelog
|
||||
|
||||
## 1.0.6.6
|
||||
|
||||
### Bug fixes:
|
||||
|
||||
* Load correct connection string when using SQLite @Kukks
|
||||
* Greenfeld API: Invoice Metadata update was not updating @saliehendricks
|
||||
* Prevent access to wallet pags if wallet not set @dennisreimann
|
||||
|
||||
### New features
|
||||
|
||||
* Greenfield API: Can configure lightning payment methods @Kukks
|
||||
|
||||
## 1.0.6.5:
|
||||
|
||||
### Improvements:
|
||||
@ -18,7 +30,7 @@
|
||||
* Do not include Tor Location header when querying the modal checkout (see #2180) @Kukks
|
||||
* Webhooks should not be randomly deleted anymore. @NicolasDorier
|
||||
* Fix header not showing properly after login to BTCPay Server (see #2155) @dennisreimann
|
||||
|
||||
* Bug: Searching invoices was timing out if there was too much invoices @rockstardev @Kukks
|
||||
|
||||
### Miscellaneous:
|
||||
|
||||
|
Reference in New Issue
Block a user