Skip to content

Commit

Permalink
Adding transactions also in Collection finilized method
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriiDiachuk committed Oct 18, 2024
1 parent ef8d3af commit 7630bf9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions module/state_synchronization/indexer/collection_executed_metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,18 @@ func (c *CollectionExecutedMetricImpl) CollectionFinalized(light flow.LightColle
if ti, found := c.collectionsToMarkFinalized.ByID(light.ID()); found {
for _, t := range light.Transactions {
c.accessMetrics.TransactionFinalized(t, ti)

block, err := c.blocks.ByCollectionID(light.ID())
if err != nil {
c.log.Warn().Err(err).Msg("could not find block by collection ID")
continue
}

err = c.blockTransactions.Append(block.ID(), t)
if err != nil {
c.log.Warn().Err(err).Msg("could not append finalized tx to track sealed transactions")
continue
}
}
c.collectionsToMarkFinalized.Remove(light.ID())
}
Expand Down

0 comments on commit 7630bf9

Please sign in to comment.