try fix tor socks5 connection

This commit is contained in:
Kukks
2020-03-14 12:21:12 +01:00
parent 56d5e6f99f
commit 1a62ee9260
8 changed files with 74 additions and 70 deletions

View File

@@ -156,26 +156,24 @@ namespace BTCPayServer.Controllers
return result.PSBT;
}
private async Task<PSBT> TryGetBPProposedTX(PSBT psbt, DerivationSchemeSettings derivationSchemeSettings, BTCPayNetwork btcPayNetwork)
{
if (TempData.TryGetValue( "bpu", out var bpu) && !string.IsNullOrEmpty(bpu?.ToString()) && Uri.TryCreate(bpu.ToString(), UriKind.Absolute, out var endpoint))
{
TempData.Remove("bpu");
HttpClient httpClient;
if (endpoint.IsOnion() )
var httpClient = _socks5HttpClientFactory.CreateClient("payjoin");
if (endpoint.IsOnion() && httpClient == null)
{
httpClient = await _socketFactory.SocksClient;
if (httpClient == null)
{
return null;
}
return null;
}
else
{
httpClient = _httpClientFactory.CreateClient("bpu");
httpClient = _httpClientFactory.CreateClient("payjoin");
}
var cloned = psbt.Clone();
if (!cloned.IsAllFinalized() && !cloned.TryFinalize(out var errors))