Skip to content

Commit

Permalink
Merge pull request #419 from raistlinthewiz/develop
Browse files Browse the repository at this point in the history
v0.1.5 PR
  • Loading branch information
Hüseyin Uslu committed Sep 5, 2014
2 parents 172367c + 3ea966e commit 147b6e9
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 4 deletions.
25 changes: 25 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
##### [v0.1.5 alpha](https://github.com/CoiniumServ/CoiniumServ/releases/tag/v0.1.5-alpha) - 05.09.2014

**Payments**
* Fixed a bug in hybrid-storage layer where blocks were not correctly set as confirmed once they were actually so.

**Web**
* Fixed a bug in embedded web-server where some users were not able to use the interface.
* Updated web-site tempaltes which reflects newest API changes.

**Storage**
* Fixed a bug in migration-manager where if it couldn't connect to MySQL would cause program to crash & terminate.

**API**
* Improved pool API.

**Pools**
* Pools can now determine if connection to coin network is healthy.
* Fixed hashrate calculation bug.

**Jobs**
* JobTracker can now clean expired jobs.

**Configuration**
* Moved config.json "website:stats" section to upper level and renamed as "statistics". You have to apply the change to your existing config.json file!

##### [v0.1.4 alpha](https://github.com/CoiniumServ/CoiniumServ/releases/tag/v0.1.4-alpha) - 03.09.2014

**Storage**
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ You can send tips and furher support the project or get tips for contributing by

### Status

[v0.1.4 alpha](https://github.com/CoiniumServ/CoiniumServ/releases/tag/v0.1.4-alpha) released
[v0.1.5 alpha](https://github.com/CoiniumServ/CoiniumServ/releases/tag/v0.1.5-alpha) released

### Features

Expand Down
34 changes: 32 additions & 2 deletions src/CoiniumServ/Persistance/Layers/Mpos/MposStorageLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public MposStorageLayer(IEnumerable<IStorageProvider> providers, PoolConfig pool
if (provider is IMySqlProvider)
_mySqlProvider = (IMySqlProvider) provider;
}

IsEnabled = _mySqlProvider != null;
}

public void AddShare(IShare share)
Expand Down Expand Up @@ -151,12 +153,34 @@ public Dictionary<uint, Dictionary<string, double>> GetShares(IList<IPaymentRoun

public void DeleteExpiredHashrateData(int until)
{
throw new NotImplementedException();
// MPOS doesn't use another hashrate data structure except the shares, which are already handled by MPOS.
}

public IDictionary<string, double> GetHashrateData(int since)
{
throw new NotImplementedException();
var hashrateData = new Dictionary<string, double>();

try
{
if (!IsEnabled)
return hashrateData;

using (var connection = new MySqlConnection(_mySqlProvider.ConnectionString))
{
var results = connection.Query(@"select username, sum(difficulty) as shares from shares where our_result='Y' group by username");

foreach (var row in results)
{
hashrateData.Add(row.username, row.shares);
}
}
}
catch (Exception e)
{
_logger.Error("An exception occured while getting share data: {0:l}", e.Message);
}

return hashrateData;
}

public void AddBlock(IShare share)
Expand Down Expand Up @@ -283,6 +307,9 @@ public bool Authenticate(IMiner miner)
{
try
{
if (!IsEnabled)
return false;

using (var connection = new MySqlConnection(_mySqlProvider.ConnectionString))
{
// query the username against mpos pool_worker table.
Expand All @@ -306,6 +333,9 @@ public void UpdateDifficulty(IStratumMiner miner)
{
try
{
if (!IsEnabled)
return;

using (var connection = new MySqlConnection(_mySqlProvider.ConnectionString))
{
connection.Execute(
Expand Down
2 changes: 1 addition & 1 deletion src/CoiniumServ/Utils/Versions/VersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static class Assembly
/// <summary>
/// Main assemby version.
/// </summary>
public const string Version = "0.1.4.*";
public const string Version = "0.1.5.*";
}
}
}

0 comments on commit 147b6e9

Please sign in to comment.