Fix warnings and bump nbxplorer

This commit is contained in:
nicolas.dorier 2018-10-26 19:06:06 +09:00
parent 3921a3ca22
commit c430d470c4
4 changed files with 12 additions and 6 deletions

View file

@ -240,10 +240,8 @@ namespace BTCPayServer.Tests
{
case 1:
return 0.5m;
break;
default:
return 1.01m;
break;
}
};
@ -281,13 +279,17 @@ namespace BTCPayServer.Tests
{
}
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
public override async Task<IEnumerable<CurrencyFull>> GetCurrenciesFull()
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
{
GetCurrenciesFullCallCount++;
return GetCurrenciesFullResult;
}
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
public override async Task<decimal> GetExchangeAmount(string fromCurrency,
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
string toCurrency, decimal amount)
{
GetExchangeAmountCallCount++;

View file

@ -65,7 +65,7 @@ services:
nbxplorer:
image: nicolasdorier/nbxplorer:1.0.3.3
image: nicolasdorier/nbxplorer:1.1.0.1
ports:
- "32838:32838"
expose:

View file

@ -39,8 +39,6 @@ namespace BTCPayServer.Services.Fees
ExplorerClient _ExplorerClient;
public async Task<FeeRate> GetFeeRateAsync()
{
if (!_ExplorerClient.Network.SupportEstimatesSmartFee)
return _Factory.Fallback;
try
{
return (await _ExplorerClient.GetFeeRateAsync(_Factory.BlockTarget).ConfigureAwait(false)).FeeRate;

View file

@ -40,7 +40,13 @@ namespace BTCPayServer.Services.Invoices
private CustomThreadPool _IndexerThread;
public InvoiceRepository(ApplicationDbContextFactory contextFactory, string dbreezePath)
{
_Engine = new DBreezeEngine(dbreezePath);
int retryCount = 0;
retry:
try
{
_Engine = new DBreezeEngine(dbreezePath);
}
catch when (retryCount++ < 5) { goto retry; }
_IndexerThread = new CustomThreadPool(1, "Invoice Indexer");
_ContextFactory = contextFactory;
}