Skip to content

Commit

Permalink
Fix balance snapshots, close #176
Browse files Browse the repository at this point in the history
  • Loading branch information
Groxan committed Aug 1, 2024
1 parent b14c3a0 commit 6d197a5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void BootstrapSnapshotBalances(List<Account> accounts)
AccountId = x.Id,
BakerId = x.DelegateId ?? x.Id,
OwnDelegatedBalance = x.Balance - (x as Data.Models.Delegate)?.OwnStakedBalance ?? 0,
OwnDelegatedBalance = x.Balance - ((x as Data.Models.Delegate)?.OwnStakedBalance ?? 0),
ExternalDelegatedBalance = (x as Data.Models.Delegate)?.DelegatedBalance ?? 0,
DelegatorsCount = (x as Data.Models.Delegate)?.DelegatorsCount ?? 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ UNION ALL
INNER JOIN "Accounts" as unstakedBaker
ON unstakedBaker."Id" = account."UnstakedBakerId"
WHERE unstakedBaker."Staked" = true
AND account."UnstakedBakerId" != account."DelegateId"
AND account."UnstakedBakerId" IS DISTINCT FROM account."DelegateId"
AND account."UnstakedBakerId" != account."Id"
""");
}
Expand Down

0 comments on commit 6d197a5

Please sign in to comment.