Skip to content

Commit

Permalink
Merge pull request #374 from CoiniumServ/develop
Browse files Browse the repository at this point in the history
Sync master with develop 0.1.2a
  • Loading branch information
Hüseyin Uslu committed Aug 15, 2014
2 parents bdf3d28 + ef28e35 commit 41ed39d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/CoiniumServ/Persistance/Redis/Redis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -372,7 +371,7 @@ public IEnumerable<IPersistedBlock> 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();
Expand Down

0 comments on commit 41ed39d

Please sign in to comment.