From f4af4117021f74c23bdcc713ceef1233856582e2 Mon Sep 17 00:00:00 2001 From: Oliver Weichhold Date: Mon, 5 Dec 2022 11:45:33 +0100 Subject: [PATCH] Remove obsolete StratumShare object. Fixes #1536 --- src/Miningcore/Blockchain/Bitcoin/BitcoinPool.cs | 2 +- src/Miningcore/Blockchain/Cryptonote/CryptonotePool.cs | 2 +- src/Miningcore/Blockchain/Equihash/EquihashPool.cs | 2 +- src/Miningcore/Blockchain/Ergo/ErgoPool.cs | 2 +- src/Miningcore/Blockchain/Ethereum/EthereumPool.cs | 2 +- src/Miningcore/Mining/ShareReceiver.cs | 2 +- src/Miningcore/Mining/ShareRecorder.cs | 6 +++--- src/Miningcore/Mining/ShareRelay.cs | 2 +- src/Miningcore/Mining/StratumShare.cs | 6 ------ 9 files changed, 10 insertions(+), 16 deletions(-) delete mode 100644 src/Miningcore/Mining/StratumShare.cs diff --git a/src/Miningcore/Blockchain/Bitcoin/BitcoinPool.cs b/src/Miningcore/Blockchain/Bitcoin/BitcoinPool.cs index 25ca34d12..9cd035599 100644 --- a/src/Miningcore/Blockchain/Bitcoin/BitcoinPool.cs +++ b/src/Miningcore/Blockchain/Bitcoin/BitcoinPool.cs @@ -185,7 +185,7 @@ protected virtual async Task OnSubmitAsync(StratumConnection connection, Timesta await connection.RespondAsync(true, request.Id); // publish - messageBus.SendMessage(new StratumShare(connection, share)); + messageBus.SendMessage(share); // telemetry PublishTelemetry(TelemetryCategory.Share, clock.Now - tsRequest.Timestamp.UtcDateTime, true); diff --git a/src/Miningcore/Blockchain/Cryptonote/CryptonotePool.cs b/src/Miningcore/Blockchain/Cryptonote/CryptonotePool.cs index 019d7f3fa..5944ad407 100644 --- a/src/Miningcore/Blockchain/Cryptonote/CryptonotePool.cs +++ b/src/Miningcore/Blockchain/Cryptonote/CryptonotePool.cs @@ -249,7 +249,7 @@ private async Task OnSubmitAsync(StratumConnection connection, Timestamped "Online"); - return messageBus.Listen() + return messageBus.Listen() .ObserveOn(TaskPoolScheduler.Default) - .Where(x => x.Share != null) - .Select(x => x.Share) + .Where(x => x != null) + .Select(x => x) .Buffer(TimeSpan.FromSeconds(5), 250) .Where(shares => shares.Any()) .Select(shares => Observable.FromAsync(() => diff --git a/src/Miningcore/Mining/ShareRelay.cs b/src/Miningcore/Mining/ShareRelay.cs index be16a30d5..94f6a3ccf 100644 --- a/src/Miningcore/Mining/ShareRelay.cs +++ b/src/Miningcore/Mining/ShareRelay.cs @@ -101,7 +101,7 @@ private void CheckQueueBacklog() public Task StartAsync(CancellationToken ct) { - messageBus.Listen().Subscribe(x => queue.Add(x.Share, ct)); + messageBus.Listen().Subscribe(x => queue.Add(x, ct)); pubSocket = new ZSocket(ZSocketType.PUB); diff --git a/src/Miningcore/Mining/StratumShare.cs b/src/Miningcore/Mining/StratumShare.cs deleted file mode 100644 index 4824d565e..000000000 --- a/src/Miningcore/Mining/StratumShare.cs +++ /dev/null @@ -1,6 +0,0 @@ -using Miningcore.Blockchain; -using Miningcore.Stratum; - -namespace Miningcore.Mining; - -public record StratumShare(StratumConnection Connection, Share Share);