Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Commit

Permalink
Remove obsolete StratumShare object. Fixes #1536
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Weichhold committed Dec 5, 2022
1 parent f93bee0 commit d3dcec6
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/Miningcore/Blockchain/Bitcoin/BitcoinPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Miningcore/Blockchain/Cryptonote/CryptonotePool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ private async Task OnSubmitAsync(StratumConnection connection, Timestamped<JsonR
await connection.RespondAsync(new CryptonoteResponseBase(), request.Id);

// publish
messageBus.SendMessage(new StratumShare(connection, share));
messageBus.SendMessage(share);

// telemetry
PublishTelemetry(TelemetryCategory.Share, clock.Now - tsRequest.Timestamp.UtcDateTime, true);
Expand Down
2 changes: 1 addition & 1 deletion src/Miningcore/Blockchain/Equihash/EquihashPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,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);
Expand Down
2 changes: 1 addition & 1 deletion src/Miningcore/Blockchain/Ergo/ErgoPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,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);
Expand Down
2 changes: 1 addition & 1 deletion src/Miningcore/Blockchain/Ethereum/EthereumPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ private async Task OnSubmitAsync(StratumConnection connection, Timestamped<JsonR
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);
Expand Down
2 changes: 1 addition & 1 deletion src/Miningcore/Mining/ShareReceiver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ private void ProcessMessage(string url, ZMessage msg)
// store
share.PoolId = topic;
share.Created = clock.Now;
messageBus.SendMessage(new StratumShare(null, share));
messageBus.SendMessage(share);

// update poolstats from shares
if(poolContext != null)
Expand Down
6 changes: 3 additions & 3 deletions src/Miningcore/Mining/ShareRecorder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,10 @@ protected override Task ExecuteAsync(CancellationToken ct)
{
logger.Info(() => "Online");

return messageBus.Listen<StratumShare>()
return messageBus.Listen<Share>()
.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(() =>
Expand Down
2 changes: 1 addition & 1 deletion src/Miningcore/Mining/ShareRelay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private void CheckQueueBacklog()

public Task StartAsync(CancellationToken ct)
{
messageBus.Listen<StratumShare>().Subscribe(x => queue.Add(x.Share, ct));
messageBus.Listen<Share>().Subscribe(x => queue.Add(x, ct));

pubSocket = new ZSocket(ZSocketType.PUB);

Expand Down
6 changes: 0 additions & 6 deletions src/Miningcore/Mining/StratumShare.cs

This file was deleted.

0 comments on commit d3dcec6

Please sign in to comment.