Skip to content

Commit 41ed39d

Browse files
author
Hüseyin Uslu
committed
Merge pull request #374 from CoiniumServ/develop
Sync master with develop 0.1.2a
2 parents bdf3d28 + ef28e35 commit 41ed39d

File tree

1 file changed

+3
-4
lines changed
  • src/CoiniumServ/Persistance/Redis

1 file changed

+3
-4
lines changed

src/CoiniumServ/Persistance/Redis/Redis.cs

+3-4
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ public void AddBlock(IShare share)
119119

120120
// add block to pending.
121121
var pendingKey = string.Format("{0}:blocks:pending", _coin);
122-
// entry format: blockHash:txHash:Amount
123-
var entry = string.Format("{0}:{1}:{2}", share.BlockHash.ToHexString(), share.Block.Tx.First(), share.GenerationTransaction.TotalAmount);
122+
var entry = string.Format("{0}:{1}:{2}", share.BlockHash.ToHexString(), share.Block.Tx.First(), share.GenerationTransaction.TotalAmount); // entry format: blockHash:txHash:Amount
124123
_client.ZAdd(pendingKey, Tuple.Create(share.Block.Height, entry));
125124
}
126125

@@ -235,7 +234,7 @@ public void MoveBlock(IPaymentRound round)
235234
break;
236235
}
237236

238-
var entry = string.Format("{0}:{1}", round.Block.BlockHash, round.Block.TransactionHash);
237+
var entry = string.Format("{0}:{1}:{2}", round.Block.BlockHash, round.Block.TransactionHash, round.Block.Amount); // entry format: blockHash:txHash:Amount
239238

240239
//_client.StartPipeTransaction(); // batch the commands as atomic.
241240
_client.ZRemRangeByScore(pendingKey, round.Block.Height, round.Block.Height);
@@ -372,7 +371,7 @@ public IEnumerable<IPersistedBlock> GetBlocks(BlockStatus status)
372371
}
373372
catch (Exception e)
374373
{
375-
_logger.Error("An exception occured while getting {0:l} blocks: {1:l}", status.ToString(), e.Message);
374+
_logger.Error("An exception occured while getting {0:l} blocks: {1:l}", status.ToString().ToLower(), e.Message);
376375
}
377376

378377
return blocks.Values.ToList();

0 commit comments

Comments
 (0)