Skip to content

Commit

Permalink
feat: avoid useless sql query to insert already existing accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag authored and flemzord committed May 12, 2023
1 parent faa48e4 commit d55ebeb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/ledger/query/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,13 @@ func buildData(

logsData.transactionsToInsert = append(logsData.transactionsToInsert, expandedTx)

for account := range txVolumeAggregator.PostCommitVolumes {
l:
for account, volumes := range txVolumeAggregator.PreCommitVolumes {
for _, volume := range volumes {
if volume.Output.Cmp(core.Zero) != 0 || volume.Input.Cmp(core.Zero) != 0 {
continue l
}
}
logsData.ensureAccountsExist = append(logsData.ensureAccountsExist, account)
}

Expand Down

0 comments on commit d55ebeb

Please sign in to comment.