Compare commits

...

3 Commits

Author SHA1 Message Date
858da35539 Bump NBitcoin 2021-10-12 15:43:17 +09:00
ed52a1012a bump nbx 2021-10-06 19:26:33 +09:00
8ee0a97e9c Replace pruning wallet by wipe transactions 2021-10-06 19:19:01 +09:00
4 changed files with 11 additions and 12 deletions

View File

@ -27,7 +27,7 @@
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="NBitcoin" Version="6.0.8" />
<PackageReference Include="NBitcoin" Version="6.0.12" />
<PackageReference Include="BTCPayServer.Lightning.Common" Version="1.2.6" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup>

View File

@ -4,7 +4,7 @@
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="NBXplorer.Client" Version="4.1.0" />
<PackageReference Include="NBXplorer.Client" Version="4.1.2" />
</ItemGroup>
<ItemGroup Condition="'$(Altcoins)' != 'true'">
<Compile Remove="Altcoins\**\*.cs"></Compile>

View File

@ -1154,20 +1154,19 @@ namespace BTCPayServer.Controllers
TempData[WellKnownTempData.SuccessMessage] = "Wallet settings updated";
return RedirectToAction(nameof(WalletSettings));
}
else if (command == "prune")
else if (command == "clear")
{
var result = await ExplorerClientProvider.GetExplorerClient(walletId.CryptoCode)
.PruneAsync(derivationScheme.AccountDerivation, new PruneRequest(), cancellationToken);
if (result.TotalPruned == 0)
if (Version.TryParse(_dashboard.Get(walletId.CryptoCode)?.Status?.Version ?? "0.0.0.0", out var v) &&
v < new Version(2, 2, 4))
{
TempData[WellKnownTempData.SuccessMessage] = $"The wallet is already pruned";
TempData[WellKnownTempData.ErrorMessage] = $"This version of NBXplorer doesn't support this operation, please upgrade to 2.2.4 or above";
}
else
{
TempData[WellKnownTempData.SuccessMessage] =
$"The wallet has been successfully pruned ({result.TotalPruned} transactions have been removed from the history)";
await ExplorerClientProvider.GetExplorerClient(walletId.CryptoCode)
.WipeAsync(derivationScheme.AccountDerivation, cancellationToken);
TempData[WellKnownTempData.SuccessMessage] = $"The transactions have been wiped out, to restore your balance, rescan the wallet.";
}
return RedirectToAction(nameof(WalletSettings));
}
else if (command == "view-seed" && await CanUseHotWallet())

View File

@ -1,4 +1,4 @@
@using Newtonsoft.Json
@using Newtonsoft.Json
@using System.Text
@using NBitcoin.DataEncoders
@model WalletSettingsViewModel
@ -70,7 +70,7 @@
Other actions...
</button>
<div class="dropdown-menu" aria-labelledby="OtherActionsDropdownToggle">
<button name="command" type="submit" class="dropdown-item" value="prune">Prune old transactions from history</button>
<button name="command" type="submit" class="dropdown-item" value="clear">Clear all transactions from history</button>
@if (Model.NBXSeedAvailable)
{
<button name="command" type="submit" class="dropdown-item" value="view-seed">View seed</button>