Update HBitcoin, make sure at headersyncing mixing is not available
MODIFY
HiddenWallet/HiddenWallet.API/Controllers/WalletController.cs
HiddenWallet/HiddenWallet.API/Controllers/WalletController.cs
@@ -9,6 +9,7 @@ using HBitcoin.KeyManagement;
using NBitcoin;
using System.Globalization;
using HBitcoin.Models;
+using HBitcoin.Fees;
namespace HiddenWallet.API.Controllers
{
@@ -320,7 +321,7 @@ namespace HiddenWallet.API.Controllers
{
try
{
- return new ObjectResult(Global.WalletWrapper.GetTumblerServerResponse());
+ return new ObjectResult(Global.WalletWrapper.GetTumblerServerResponseAsync().Result);
}
catch (Exception ex)
{

MODIFY
HiddenWallet/HiddenWallet.API/HiddenWallet.API.csproj
HiddenWallet/HiddenWallet.API/HiddenWallet.API.csproj
<RuntimeIdentifiers>win7-x64;win8-x64;win81-x64;win10-x64;osx.10.10-x64;osx.10.11-x64;osx.10.12-x64;ubuntu.14.04-x64;ubuntu.14.10-x64;ubuntu.15.04-x64;ubuntu.15.10-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;debian.8-x64;linuxmint.17-x64;linuxmint.17.1-x64;linuxmint.17.2-x64;linuxmint.17.3-x64;linuxmint.18-x64;win7-x86;win8-x86;win81-x86;win10-x86</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>
- <PackageReference Include="HBitcoin" Version="0.2.2" />
+ <PackageReference Include="HBitcoin" Version="0.2.4" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.2" />

MODIFY
HiddenWallet/HiddenWallet.API/Wrappers/WalletWrapper.cs
HiddenWallet/HiddenWallet.API/Wrappers/WalletWrapper.cs
@@ -16,6 +16,7 @@ using System.Threading.Tasks;
using static HBitcoin.FullBlockSpv.WalletJob;
using DotNetTor.SocksPort;
using HBitcoin.TumbleBit.ClassicTumbler;
+using HBitcoin.Fees;
namespace HiddenWallet.API.Wrappers
{
@@ -287,7 +288,7 @@ namespace HiddenWallet.API.Wrappers
else return new FailureResponse { Message = result.FailingReason, Details = "" };
}
- public TumblerServerResponse GetTumblerServerResponse()
+ public async Task<TumblerServerResponse> GetTumblerServerResponseAsync()
{
var addressUri = Network == Network.Main ? Config.TumbleBitServerMainNet : Config.TumbleBitServerTestNet;
var address = "";
@@ -305,7 +306,7 @@ namespace HiddenWallet.API.Wrappers
{
return new TumblerServerResponse { Address = address, Status = "TumblerServerIssues", Denomination = "", FeePercent = "", SatoshiFeePerBytes = "", CycleLengthMinutes = "" };
}
- var satoshiFeePerBytes = _walletJob.TumbleBitRuntime.Services.FeeService.GetFeeRate().FeePerK.ToDecimal(MoneyUnit.Satoshi) / 1000;
+ var satoshiFeePerBytes = (await _walletJob.FeeJob.GetFeePerBytesAsync(FeeType.High, default(CancellationToken)).ConfigureAwait(false)).ToDecimal(MoneyUnit.Satoshi);
var periods = _walletJob.TumbleBitRuntime.TumblerParameters.CycleGenerator.FirstCycle.GetPeriods();
var lengthBlocks = periods.Total.End - periods.Total.Start;
var cycleLengthMinutes = lengthBlocks * 10;

MODIFY
HiddenWallet/HiddenWallet.GUI/app/js/wallet-phase.js
HiddenWallet/HiddenWallet.GUI/app/js/wallet-phase.js
@@ -109,7 +109,12 @@ function chooseWalletDropdown(aliceBob = "") {
function amountChanged() {
let cycleCount = document.getElementById("amount-input").value / tumblerDenomination;
- document.getElementById("tumbling-network-fees").innerText = cycleCount * estCycleFee + " BTC";
+ document.getElementById("tumbling-network-fees").innerText = round(cycleCount * estCycleFee, 8) + " BTC";
+}
+
+function round(value, precision) {
+ var multiplier = Math.pow(10, precision || 0);
+ return Math.round(value * multiplier) / multiplier;
}
let tumblerAddress;
@@ -129,7 +134,9 @@ function mixerShow() {
document.getElementById("tumbler-address").value = resp.Address;
document.getElementById("tumbler-status").innerText = resp.Status;
- if (blocksLeftToSync !== 0 && blocksLeftToSync !== 1 && blocksLeftToSync !== 2) {
+ if (walletState.toUpperCase() === "SyncingHeaders".toUpperCase()
+ || walletState.toUpperCase() === "NotStarted".toUpperCase()
+ || (blocksLeftToSync !== 0 && blocksLeftToSync !== 1 && blocksLeftToSync !== 2)) {
document.getElementById("tumbler-status").innerText = "WalletIsNotSynced";
document.getElementById("tumbler-status").classList.add("label-danger");
document.getElementById("mixer-settings-content").style.display = "none";

Update HBitcoin, make sure at headersyncing mixing is not available