Skip to content

Commit 524c96e

Browse files
committed
[FAB-1686]Remove unused arg,method,variable
https://jira.hyperledger.org/browse/FAB-1686 Change-Id: I0b2d784f52f4f38f6afa03ca750188c369b2cc62 Signed-off-by: grapebaba <[email protected]>
1 parent 22ec03f commit 524c96e

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

core/ledger/blkstorage/fsblkstorage/blockfile_mgr.go

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import (
3535
var logger = logging.MustGetLogger("kvledger")
3636

3737
const (
38-
blockIndexCF = "blockIndexCF"
3938
blockfilePrefix = "blockfile_"
4039
)
4140

core/ledger/blkstorage/fsblkstorage/blockindex.go

+4-8
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (index *blockIndex) getLastBlockIndexed() (uint64, error) {
7676
}
7777

7878
func (index *blockIndex) indexBlock(blockIdxInfo *blockIdxInfo) error {
79-
// do not index anyting
79+
// do not index anything
8080
if len(index.indexItemsMap) == 0 {
8181
logger.Debug("Not indexing block... as nothing to index")
8282
return nil
@@ -100,7 +100,7 @@ func (index *blockIndex) indexBlock(blockIdxInfo *blockIdxInfo) error {
100100
batch.Put(constructBlockNumKey(blockIdxInfo.blockNum), flpBytes)
101101
}
102102

103-
//Index3 Used to find a transactin by it's transaction id
103+
//Index3 Used to find a transaction by it's transaction id
104104
if _, ok := index.indexItemsMap[blkstorage.IndexableAttrTxID]; ok {
105105
for _, txoffset := range txOffsets {
106106
txFlp := newFileLocationPointer(flp.fileSuffixNum, flp.offset, txoffset.loc)
@@ -217,10 +217,6 @@ func constructBlockNumTranNumKey(blockNum uint64, txNum uint64) []byte {
217217
return append([]byte{blockNumTranNumIdxKeyPrefix}, key...)
218218
}
219219

220-
func constructTxID(blockNum uint64, txNum int) string {
221-
return fmt.Sprintf("%d:%d", blockNum, txNum)
222-
}
223-
224220
func encodeBlockNum(blockNum uint64) []byte {
225221
return proto.EncodeVarint(blockNum)
226222
}
@@ -246,9 +242,9 @@ type fileLocPointer struct {
246242
locPointer
247243
}
248244

249-
func newFileLocationPointer(fileSuffixNum int, begginingOffset int, relativeLP *locPointer) *fileLocPointer {
245+
func newFileLocationPointer(fileSuffixNum int, beginningOffset int, relativeLP *locPointer) *fileLocPointer {
250246
flp := &fileLocPointer{fileSuffixNum: fileSuffixNum}
251-
flp.offset = begginingOffset + relativeLP.offset
247+
flp.offset = beginningOffset + relativeLP.offset
252248
flp.bytesLength = relativeLP.bytesLength
253249
return flp
254250
}

core/ledger/blkstorage/fsblkstorage/pkg_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func (w *testBlockfileMgrWrapper) testGetBlockByNumber(blocks []*common.Block, s
9696
// test getting the last block
9797
b, err := w.blockfileMgr.retrieveBlockByNumber(math.MaxUint64)
9898
iLastBlock := len(blocks) - 1
99-
testutil.AssertNoError(w.t, err, fmt.Sprintf("Error while retrieving last block from blockfileMgr"))
99+
testutil.AssertNoError(w.t, err, "Error while retrieving last block from blockfileMgr")
100100
testutil.AssertEquals(w.t, b, blocks[iLastBlock])
101101
}
102102

0 commit comments

Comments
 (0)