Improved JSON RPC send logging
@@ -338,8 +338,6 @@ public class StratumConnection
private async Task SendMessage(object msg, CancellationToken ct)
{
- logger.Debug(() => $"[{ConnectionId}] Sending: {JsonConvert.SerializeObject(msg)}");
-
var buffer = ArrayPool<byte>.Shared.Rent(MaxOutboundRequestLength);
try
@@ -350,6 +348,8 @@ public class StratumConnection
var cb = SerializeMessage(msg, buffer);
+ logger.Debug(() => $"[{ConnectionId}] Sending: {StratumConstants.Encoding.GetString(buffer.AsSpan(0, cb))}");
+
await networkStream.WriteAsync(buffer, 0, cb, ctsTimeout.Token);
await networkStream.FlushAsync(ctsTimeout.Token);
}
