mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 14:22:40 +01:00
Fix synching information
This commit is contained in:
parent
1521ec8071
commit
dfed2daa8e
3 changed files with 21 additions and 3 deletions
|
@ -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\**" />
|
||||
|
|
|
@ -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 { }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@
|
|||
<button type="button" class="close" data-dismiss="modal">×</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)"
|
||||
|
|
Loading…
Add table
Reference in a new issue