Fix synching information

This commit is contained in:
nicolas.dorier 2017-12-17 11:07:11 +09:00
parent 1521ec8071
commit dfed2daa8e
3 changed files with 21 additions and 3 deletions

View file

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<Version>1.0.0.41</Version>
<Version>1.0.0.42</Version>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Build\dockerfiles\**" />

View file

@ -119,14 +119,32 @@ namespace BTCPayServer
}
break;
}
LastStatus = status;
if (oldState != State)
{
Logs.PayServer.LogInformation($"NBXplorerWaiter status changed: {oldState} => {State}");
if (State == NBXplorerState.Synching)
{
SetInterval(TimeSpan.FromSeconds(10));
}
else
{
SetInterval(TimeSpan.FromMinutes(1));
}
}
return oldState != State;
}
private void SetInterval(TimeSpan interval)
{
try
{
_Timer.Change(0, (int)interval.TotalMilliseconds);
}
catch { }
}
public Task<T> WhenReady<T>(Func<ExplorerClient, Task<T>> act)
{
if (State == NBXplorerState.Ready)
@ -162,7 +180,7 @@ namespace BTCPayServer
var status = await _Client.GetStatusAsync(cancellation).ConfigureAwait(false);
return status;
}
catch (OperationCanceledException) { throw; }
catch (OperationCanceledException) { }
catch { }
}
}

View file

@ -130,7 +130,7 @@
<button type="button" class="close" data-dismiss="modal">&times;</button>
</div>
<div class="modal-body">
<p>Bitcoin Core is synching (Chain height: @lastStatus.ChainHeight, Block height: @lastStatus.NodeBlocks)</p>
<p>Bitcoin Core is synching (Chain height: @lastStatus.NodeHeaders, Block height: @lastStatus.NodeBlocks)</p>
<p>BTCPay Server will not work correctly until it is over.</p>
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="@((int)verificationProgress)"