From bb50c6f5fe3c48114fdde0bcf6f8cb62f4bb26e9 Mon Sep 17 00:00:00 2001 From: bonesoul Date: Thu, 14 Aug 2014 17:41:57 +0300 Subject: [PATCH 1/2] updated a log message. --- src/CoiniumServ/Persistance/Redis/Redis.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CoiniumServ/Persistance/Redis/Redis.cs b/src/CoiniumServ/Persistance/Redis/Redis.cs index cefa4beac..6b0f47b5d 100644 --- a/src/CoiniumServ/Persistance/Redis/Redis.cs +++ b/src/CoiniumServ/Persistance/Redis/Redis.cs @@ -372,7 +372,7 @@ public IEnumerable GetBlocks(BlockStatus status) } catch (Exception e) { - _logger.Error("An exception occured while getting {0:l} blocks: {1:l}", status.ToString(), e.Message); + _logger.Error("An exception occured while getting {0:l} blocks: {1:l}", status.ToString().ToLower(), e.Message); } return blocks.Values.ToList(); From 47cd3e049ae6751d4354d01754358f0e7233820f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20Uslu?= Date: Fri, 15 Aug 2014 10:11:38 +0300 Subject: [PATCH 2/2] Fixed a bug in redis - while moving blocks to confirmed or orphaned key eventually leading errors while reading the block back. --- src/CoiniumServ/Persistance/Redis/Redis.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/CoiniumServ/Persistance/Redis/Redis.cs b/src/CoiniumServ/Persistance/Redis/Redis.cs index 6b0f47b5d..4884754ed 100644 --- a/src/CoiniumServ/Persistance/Redis/Redis.cs +++ b/src/CoiniumServ/Persistance/Redis/Redis.cs @@ -119,8 +119,7 @@ public void AddBlock(IShare share) // add block to pending. var pendingKey = string.Format("{0}:blocks:pending", _coin); - // entry format: blockHash:txHash:Amount - var entry = string.Format("{0}:{1}:{2}", share.BlockHash.ToHexString(), share.Block.Tx.First(), share.GenerationTransaction.TotalAmount); + var entry = string.Format("{0}:{1}:{2}", share.BlockHash.ToHexString(), share.Block.Tx.First(), share.GenerationTransaction.TotalAmount); // entry format: blockHash:txHash:Amount _client.ZAdd(pendingKey, Tuple.Create(share.Block.Height, entry)); } @@ -235,7 +234,7 @@ public void MoveBlock(IPaymentRound round) break; } - var entry = string.Format("{0}:{1}", round.Block.BlockHash, round.Block.TransactionHash); + var entry = string.Format("{0}:{1}:{2}", round.Block.BlockHash, round.Block.TransactionHash, round.Block.Amount); // entry format: blockHash:txHash:Amount //_client.StartPipeTransaction(); // batch the commands as atomic. _client.ZRemRangeByScore(pendingKey, round.Block.Height, round.Block.Height);