From 20ca2e66a6f27ebaa14bf9156d2982a7347e40f1 Mon Sep 17 00:00:00 2001 From: Iulian Pascalau Date: Tue, 22 Mar 2022 13:37:03 +0200 Subject: [PATCH] - fis after review: renaming --- process/block/preprocess/scheduledTxsExecution.go | 12 ++++++------ process/block/preprocess/transactions.go | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/process/block/preprocess/scheduledTxsExecution.go b/process/block/preprocess/scheduledTxsExecution.go index c1e784b46ac..ce3ba750d67 100644 --- a/process/block/preprocess/scheduledTxsExecution.go +++ b/process/block/preprocess/scheduledTxsExecution.go @@ -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) } @@ -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() diff --git a/process/block/preprocess/transactions.go b/process/block/preprocess/transactions.go index 464949dd733..dd22217a072 100644 --- a/process/block/preprocess/transactions.go +++ b/process/block/preprocess/transactions.go @@ -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", @@ -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) }