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

Commit

Permalink
Merge pull request #994 from coinfoundry/oliverw
Browse files Browse the repository at this point in the history
Oliverw
  • Loading branch information
Oliver Weichhold authored Nov 20, 2021
2 parents 5950a54 + b0bfca4 commit 9f183a1
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 10 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Build status](https://ci.appveyor.com/api/projects/status/nbvaa55gu3icd1q8?svg=true)](https://ci.appveyor.com/project/oliverw/miningcore)
[![.NET](https://github.com/coinfoundry/miningcore/actions/workflows/dotnet.yml/badge.svg)](https://github.com/coinfoundry/miningcore/actions/workflows/dotnet.yml)
[![license](https://img.shields.io/github/license/mashape/apistatus.svg)]()

<img src="https://github.com/coinfoundry/miningcore/raw/master/logo.png" width="150">
Expand Down
13 changes: 13 additions & 0 deletions src/.idea/.idea.Miningcore/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/.idea/.idea.Miningcore/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/.idea/.idea.Miningcore/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/.idea/.idea.Miningcore/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Miningcore.Tests/Miningcore.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<!-- Copy library binaries from Miningcore build output on Windows -->
<Target Name="CopyLibsWin" AfterTargets="AfterBuild" Condition="'$(IsWindows)' == 'true'">
<ItemGroup>
<Libs Include="$(ProjectDir)..\Miningcore\bin\$(Configuration)\netcoreapp2.2\lib*.dll" />
<Libs Include="$(ProjectDir)..\Miningcore\bin\$(Configuration)\net6.0\lib*.dll" />
</ItemGroup>

<Copy SourceFiles="@(Libs)" DestinationFolder="$(OutDir)" />
Expand All @@ -67,7 +67,7 @@
<!-- Copy library binaries from Miningcore build output on Linux -->
<Target Name="CopyLibsLinux" AfterTargets="AfterBuild" Condition="'$(IsLinux)' == 'true'">
<ItemGroup>
<Libs Include="$(ProjectDir)..\Miningcore\bin\$(Configuration)\netcoreapp2.2\lib*.so" />
<Libs Include="$(ProjectDir)..\Miningcore\bin\$(Configuration)\net6.0\lib*.so" />
</ItemGroup>

<Copy SourceFiles="@(Libs)" DestinationFolder="$(OutDir)" />
Expand Down
9 changes: 8 additions & 1 deletion src/Miningcore.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/BLANK_LINES_AROUND_AUTO_PROPERTY/@EntryValue">0</s:Int64>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/BLANK_LINES_AROUND_PROPERTY/@EntryValue">0</s:Int64>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/KEEP_EXISTING_INITIALIZER_ARRANGEMENT/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_WITHIN_SINGLE_LINE_ARRAY_INITIALIZER_BRACES/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/ALIGN_MULTILINE_BINARY_EXPRESSIONS_CHAIN/@EntryValue">False</s:Boolean>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/BLANK_LINES_AFTER_BLOCK_STATEMENTS/@EntryValue">0</s:Int64>
Expand Down Expand Up @@ -34,4 +37,8 @@
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_BEFORE_TERNARY_OPSIGNS/@EntryValue">False</s:Boolean>
<s:Int64 x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_LIMIT/@EntryValue">2735</s:Int64>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_OBJECT_AND_COLLECTION_INITIALIZER_STYLE/@EntryValue">CHOP_ALWAYS</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_TERNARY_EXPR_STYLE/@EntryValue">WRAP_IF_LONG</s:String></wpf:ResourceDictionary>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/WRAP_TERNARY_EXPR_STYLE/@EntryValue">WRAP_IF_LONG</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
8 changes: 4 additions & 4 deletions src/Miningcore/Blockchain/Ergo/ErgoJobManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private void SetupJobUpdates()

var triggers = new List<IObservable<(bool Force, string Via, string Data)>>
{
blockFound.Select(x => (false, JobRefreshBy.BlockFound, (string) null))
blockFound.Select(_ => (false, JobRefreshBy.BlockFound, (string) null))
};

if(extraPoolConfig?.BtStream != null)
Expand Down Expand Up @@ -228,7 +228,7 @@ private void ConfigureRewards()
}
}

private async Task<bool> SubmitBlockAsync(Share share, ErgoJob job, string nonce)
private async Task<bool> SubmitBlockAsync(Share share, string nonce)
{
try
{
Expand All @@ -243,7 +243,7 @@ await ergoClient.MiningSubmitSolutionAsync(new PowSolutions
catch(ApiException<ApiError> ex)
{
logger.Warn(() => $"Block {share.BlockHeight} submission failed with: {ex.Result.Detail ?? ex.Result.Reason ?? ex.Message}");
messageBus.SendMessage(new AdminNotification("Block submission failed", $"Pool {poolConfig.Id} {(!string.IsNullOrEmpty(share.Source) ? $"[{share.Source.ToUpper()}] " : string.Empty)}failed to submit block {share.BlockHeight}: {ex.Result.Detail ?? ex.Result.Reason ?? ex.Message}"));
messageBus.SendMessage(new AdminNotification("Block submission failed", $"Pool {poolConfig.Id} {(!string.IsNullOrEmpty(share.Source) ? $"[{share.Source.ToUpper()}] " : string.Empty)}failed to submit block {share.BlockHeight}: {ex.Result.Detail ?? ex.Result.Reason}"));
}

catch(Exception ex)
Expand Down Expand Up @@ -331,7 +331,7 @@ public async ValueTask<Share> SubmitShareAsync(StratumConnection worker, object
{
logger.Info(() => $"Submitting block {share.BlockHeight} [{share.BlockHash}]");

var acceptResponse = await SubmitBlockAsync(share, job, nonce);
var acceptResponse = await SubmitBlockAsync(share, nonce);

// is it still a block candidate?
share.IsBlockCandidate = acceptResponse;
Expand Down
4 changes: 1 addition & 3 deletions src/Miningcore/Blockchain/Ergo/ErgoPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,7 @@ protected virtual Task OnNewJobAsync(object[] jobParams)
if(!context.IsSubscribed || !context.IsAuthorized || CloseIfDead(connection, context))
return;

// varDiff: if the client has a pending difficulty change, apply it now
if(context.ApplyPendingDifficulty())
await SendJob(connection, context, currentJobParams);
await SendJob(connection, context, currentJobParams);
})), ex=> logger.Debug(() => $"{nameof(OnNewJobAsync)}: {ex.Message}"));
}

Expand Down

0 comments on commit 9f183a1

Please sign in to comment.