Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions indexprotocol/rewards/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,12 @@ func (p *Protocol) rebuildAccountRewardTable(tx *sql.Tx, lastEpoch uint64) error
}
}

if len(valArgs) == 0 {
return nil
}
if len(valStrs) == 0 {
return errors.Wrap(err, "error : valStrs is empty")
}
insertQuery := fmt.Sprintf(insertAccountReward, AccountRewardTableName, strings.Join(valStrs, ","))
if _, err := tx.Exec(insertQuery, valArgs...); err != nil {
return err
Expand Down