Remove unused local variables
MODIFY
WalletWasabi.Backend/Global.cs
WalletWasabi.Backend/Global.cs
@@ -95,7 +95,6 @@ namespace WalletWasabi.Backend
{
try
{
- var blockchainInfoRequest = new RPCRequest(RPCOperations.getblockchaininfo, parameters: null);
var blockchainInfo = await RpcClient.GetBlockchainInfoAsync();
var blocks = blockchainInfo.Blocks;
@@ -128,7 +127,6 @@ namespace WalletWasabi.Backend
var generateBlocksResponse = await RpcClient.GenerateAsync(101);
if (generateBlocksResponse == null) throw new NotSupportedException($"Bitcoin Core cannot cannot generate blocks on the RegTest.");
- blockchainInfoRequest = new RPCRequest(RPCOperations.getblockchaininfo, parameters: null);
blockchainInfo = await RpcClient.GetBlockchainInfoAsync();
blocks = blockchainInfo.Blocks;
if (blocks == 0)

MODIFY
WalletWasabi/Extensions/HttpRequestMessageExtensions.cs
WalletWasabi/Extensions/HttpRequestMessageExtensions.cs
@@ -30,15 +30,12 @@ namespace System.Net.Http
// CRLF
// [message - body]
- var position = 0;
string startLine = await HttpMessageHelper.ReadStartLineAsync(requestStream, ctsToken);
- position += startLine.Length;
var requestLine = RequestLine.CreateNew(startLine);
var request = new HttpRequestMessage(requestLine.Method, requestLine.URI);
string headers = await HttpMessageHelper.ReadHeadersAsync(requestStream, ctsToken);
- position += headers.Length + 2;
var headerSection = HeaderSection.CreateNew(headers);
var headerStruct = headerSection.ToHttpRequestHeaders();

MODIFY
WalletWasabi/Extensions/HttpResponseMessageExtensions.cs
WalletWasabi/Extensions/HttpResponseMessageExtensions.cs
@@ -31,15 +31,12 @@ namespace System.Net.Http
// CRLF
// [message - body]
- var position = 0;
string startLine = await HttpMessageHelper.ReadStartLineAsync(responseStream);
- position += startLine.Length;
var statusLine = StatusLine.CreateNew(startLine);
var response = new HttpResponseMessage(statusLine.StatusCode);
string headers = await HttpMessageHelper.ReadHeadersAsync(responseStream);
- position += headers.Length + 2;
var headerSection = HeaderSection.CreateNew(headers);
var headerStruct = headerSection.ToHttpResponseHeaders();

MODIFY
WalletWasabi/Helpers/HttpMessageHelper.cs
WalletWasabi/Helpers/HttpMessageHelper.cs
@@ -290,7 +290,7 @@ namespace System.Net.Http
// Remove Trailer from existing header fields
long length = 0;
var firstChunkLine = await ReadCRLFLineAsync(stream, Encoding.ASCII, ctsToken: ctsToken);
- ParseFistChunkLine(firstChunkLine, out long chunkSize, out IEnumerable<string> chunkExtensions);
+ ParseFistChunkLine(firstChunkLine, out long chunkSize, out _);
// We will not do anything with the chunk extensions, because:
// https://tools.ietf.org/html/rfc7230#section-4.1.1
// A recipient MUST ignore unrecognized chunk extensions.
@@ -318,7 +318,6 @@ namespace System.Net.Http
firstChunkLine = await ReadCRLFLineAsync(stream, Encoding.ASCII, ctsToken: ctsToken);
ParseFistChunkLine(firstChunkLine, out long cs, out IEnumerable<string> ces);
chunkSize = cs;
- chunkExtensions = ces;
}
// https://tools.ietf.org/html/rfc7230#section-4.1.2
// A trailer allows the sender to include additional fields at the end

Remove unused local variables