diff --git a/Changelog.md b/Changelog.md index bfe774e62..20c242e68 100644 --- a/Changelog.md +++ b/Changelog.md @@ -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** diff --git a/README.md b/README.md index 61e2737a7..c8ab4a1c1 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/CoiniumServ/Persistance/Layers/Mpos/MposStorageLayer.cs b/src/CoiniumServ/Persistance/Layers/Mpos/MposStorageLayer.cs index 4b5c906fc..55a2d0f01 100644 --- a/src/CoiniumServ/Persistance/Layers/Mpos/MposStorageLayer.cs +++ b/src/CoiniumServ/Persistance/Layers/Mpos/MposStorageLayer.cs @@ -56,6 +56,8 @@ public MposStorageLayer(IEnumerable providers, PoolConfig pool if (provider is IMySqlProvider) _mySqlProvider = (IMySqlProvider) provider; } + + IsEnabled = _mySqlProvider != null; } public void AddShare(IShare share) @@ -151,12 +153,34 @@ public Dictionary> GetShares(IList GetHashrateData(int since) { - throw new NotImplementedException(); + var hashrateData = new Dictionary(); + + 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) @@ -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. @@ -306,6 +333,9 @@ public void UpdateDifficulty(IStratumMiner miner) { try { + if (!IsEnabled) + return; + using (var connection = new MySqlConnection(_mySqlProvider.ConnectionString)) { connection.Execute( diff --git a/src/CoiniumServ/Utils/Versions/VersionInfo.cs b/src/CoiniumServ/Utils/Versions/VersionInfo.cs index d7a9ce419..9c00e625a 100644 --- a/src/CoiniumServ/Utils/Versions/VersionInfo.cs +++ b/src/CoiniumServ/Utils/Versions/VersionInfo.cs @@ -41,7 +41,7 @@ public static class Assembly /// /// Main assemby version. /// - public const string Version = "0.1.4.*"; + public const string Version = "0.1.5.*"; } } }