show block gap if lightning node is not synched

This commit is contained in:
nicolas.dorier 2018-02-28 23:12:09 +09:00
parent 030cb09af8
commit 346cdf2431

View file

@ -73,9 +73,10 @@ namespace BTCPayServer.Payments.Lightning
throw new Exception($"Lightning node network {info.Network}, but expected is {network.CLightningNetworkName}");
}
if (Math.Abs(info.BlockHeight - (await status).ChainHeight) > 10)
var blocksGap = Math.Abs(info.BlockHeight - (await status).ChainHeight);
if (blocksGap > 10)
{
throw new Exception($"The lightning node is not synched");
throw new Exception($"The lightning is not synched ({blocksGap} blocks)");
}
try