Skip to content

Commit

Permalink
- fis after review: renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
iulianpascalau committed Mar 22, 2022
1 parent a1d2472 commit 20ca2e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions process/block/preprocess/scheduledTxsExecution.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,14 @@ func (ste *scheduledTxsExecution) removeInvalidTxsFromScheduledMiniBlocks(interm
}
}

resultedSlice := make(block.MiniBlockSlice, 0)
resultedScheduledMbs := make(block.MiniBlockSlice, 0)
for _, miniBlock := range ste.scheduledMbs {
if len(miniBlock.TxHashes) == 0 {
continue
}
resultedSlice = append(resultedSlice, miniBlock)
resultedScheduledMbs = append(resultedScheduledMbs, miniBlock)
}
ste.scheduledMbs = resultedSlice
ste.scheduledMbs = resultedScheduledMbs

log.Debug("scheduledTxsExecution.removeInvalidTxsFromScheduledMiniBlocks", "num of invalid txs removed", numInvalidTxsRemoved)
}
Expand Down Expand Up @@ -639,9 +639,9 @@ func (ste *scheduledTxsExecution) IsScheduledTx(txHash []byte) bool {

// IsMiniBlockExecuted returns true if the given mini block is already executed
func (ste *scheduledTxsExecution) IsMiniBlockExecuted(mbHash []byte) bool {
//TODO: This method and also ste.mapScheduledMbHashes could be removed when we will have mini block header IsFinal method later,
//but only when we could differentiate between the final mini blocks executed as scheduled in the last block and the normal mini blocks
//from the current block which are also final, but not yet executed
// TODO: This method and also ste.mapScheduledMbHashes could be removed when we will have mini block header IsFinal method later,
// but only when we could differentiate between the final mini blocks executed as scheduled in the last block and the normal mini blocks
// from the current block which are also final, but not yet executed
ste.mutScheduledTxs.RLock()
_, ok := ste.mapScheduledMbHashes[string(mbHash)]
ste.mutScheduledTxs.RUnlock()
Expand Down
4 changes: 2 additions & 2 deletions process/block/preprocess/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func (txs *transactions) RestoreBlockDataIntoPools(
continue
}

miniblockStrCache := process.ShardCacherIdentifier(miniBlock.SenderShardID, miniBlock.ReceiverShardID)
miniBlockStrCache := process.ShardCacherIdentifier(miniBlock.SenderShardID, miniBlock.ReceiverShardID)
txsBuff, err := txs.storage.GetAll(dataRetriever.TransactionUnit, miniBlock.TxHashes)
if err != nil {
log.Debug("tx from mini block was not found in TransactionUnit",
Expand All @@ -272,7 +272,7 @@ func (txs *transactions) RestoreBlockDataIntoPools(
return txsRestored, err
}

strCache := txs.computeCacheIdentifier(miniblockStrCache, &tx, miniBlock.Type)
strCache := txs.computeCacheIdentifier(miniBlockStrCache, &tx, miniBlock.Type)
txs.txPool.AddData([]byte(txHash), &tx, tx.Size(), strCache)
}

Expand Down

0 comments on commit 20ca2e6

Please sign in to comment.