review fixes

This commit is contained in:
Ian Norden
2019-04-02 10:10:17 -05:00
parent 185f4c0e93
commit fd407825c1
4 changed files with 8 additions and 7 deletions
@@ -186,9 +186,9 @@ func (blockRepository BlockRepository) insertBlock(block core.Block) (int64, err
}
func (blockRepository BlockRepository) createUncleRewards(tx *sqlx.Tx, blockId int64, blockHash string, mappedUncleRewards map[string]map[string]*big.Int) error {
for miner, uncleRewards := range mappedUncleRewards {
for minerAddr, uncleRewards := range mappedUncleRewards {
for uncleHash, reward := range uncleRewards {
err := blockRepository.createUncleReward(tx, blockId, blockHash, miner, uncleHash, reward.String())
err := blockRepository.createUncleReward(tx, blockId, blockHash, minerAddr, uncleHash, reward.String())
if err != nil {
return err
}
@@ -197,13 +197,13 @@ func (blockRepository BlockRepository) createUncleRewards(tx *sqlx.Tx, blockId i
return nil
}
func (blockRepository BlockRepository) createUncleReward(tx *sqlx.Tx, blockId int64, blockHash, miner, uncleHash, amount string) error {
func (blockRepository BlockRepository) createUncleReward(tx *sqlx.Tx, blockId int64, blockHash, minerAddr, uncleHash, amount string) error {
_, err := tx.Exec(
`INSERT INTO uncle_rewards
(block_id, block_hash, uncle_hash, uncle_reward, miner_address)
(block_id, block_hash, miner_address, uncle_hash, uncle_reward)
VALUES ($1, $2, $3, $4, $5)
RETURNING id`,
blockId, blockHash, miner, uncleHash, utilities.NullToZero(amount))
blockId, blockHash, minerAddr, uncleHash, utilities.NullToZero(amount))
return err
}
@@ -1 +0,0 @@
package repositories
@@ -1 +0,0 @@
package repositories