Skip to content

db-sync: Fix pool_id column in reward table #364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 20, 2020
Merged

Conversation

erikd
Copy link
Contributor

@erikd erikd commented Oct 20, 2020

No description provided.

The 'pool_id' in the 'reward' table is obtained by querying the
'delegation' table, and that query ordered the results by
'active_epoch_no'. However, for the case where two delegation (or
pool update) certificates for the same address (or pool) are
registered in the same epoch, this query can be incorrect.

The fix is join with the 'block' table and order by the descending
value of the 'slot_no' field.

Closes: #361
@erikd erikd merged commit 17f5643 into master Oct 20, 2020
@iohk-bors iohk-bors bot deleted the erikd/issue-361 branch October 20, 2020 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant