Allow RPC access in services when the node is synching (fix #1795)

This commit is contained in:
nicolas.dorier 2020-08-04 14:16:25 +09:00
parent f2a005eeac
commit 74c80fa536
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE

View File

@ -572,15 +572,14 @@ namespace BTCPayServer.Controllers
[Route("server/services/{serviceName}/{cryptoCode?}")]
public async Task<IActionResult> Service(string serviceName, string cryptoCode, bool showQR = false, uint? nonce = null)
{
if (!string.IsNullOrEmpty(cryptoCode) && !_dashBoard.IsFullySynched(cryptoCode, out _))
var service = GetService(serviceName, cryptoCode);
if (service == null)
return NotFound();
if (!string.IsNullOrEmpty(cryptoCode) && !_dashBoard.IsFullySynched(cryptoCode, out _) && service.Type != ExternalServiceTypes.RPC)
{
TempData[WellKnownTempData.ErrorMessage] = $"{cryptoCode} is not fully synched";
return RedirectToAction(nameof(Services));
}
var service = GetService(serviceName, cryptoCode);
if (service == null)
return NotFound();
try
{