Commit 524c96e8 authored by grapebaba's avatar grapebaba
Browse files

[FAB-1686]Remove unused arg,method,variable

https://jira.hyperledger.org/browse/FAB-1686



Change-Id: I0b2d784f52f4f38f6afa03ca750188c369b2cc62
Signed-off-by: default avatargrapebaba <281165273@qq.com>
parent 22ec03f9
......@@ -35,7 +35,6 @@ import (
var logger = logging.MustGetLogger("kvledger")
const (
blockIndexCF = "blockIndexCF"
blockfilePrefix = "blockfile_"
)
......
......@@ -76,7 +76,7 @@ func (index *blockIndex) getLastBlockIndexed() (uint64, error) {
}
func (index *blockIndex) indexBlock(blockIdxInfo *blockIdxInfo) error {
// do not index anyting
// do not index anything
if len(index.indexItemsMap) == 0 {
logger.Debug("Not indexing block... as nothing to index")
return nil
......@@ -100,7 +100,7 @@ func (index *blockIndex) indexBlock(blockIdxInfo *blockIdxInfo) error {
batch.Put(constructBlockNumKey(blockIdxInfo.blockNum), flpBytes)
}
//Index3 Used to find a transactin by it's transaction id
//Index3 Used to find a transaction by it's transaction id
if _, ok := index.indexItemsMap[blkstorage.IndexableAttrTxID]; ok {
for _, txoffset := range txOffsets {
txFlp := newFileLocationPointer(flp.fileSuffixNum, flp.offset, txoffset.loc)
......@@ -217,10 +217,6 @@ func constructBlockNumTranNumKey(blockNum uint64, txNum uint64) []byte {
return append([]byte{blockNumTranNumIdxKeyPrefix}, key...)
}
func constructTxID(blockNum uint64, txNum int) string {
return fmt.Sprintf("%d:%d", blockNum, txNum)
}
func encodeBlockNum(blockNum uint64) []byte {
return proto.EncodeVarint(blockNum)
}
......@@ -246,9 +242,9 @@ type fileLocPointer struct {
locPointer
}
func newFileLocationPointer(fileSuffixNum int, begginingOffset int, relativeLP *locPointer) *fileLocPointer {
func newFileLocationPointer(fileSuffixNum int, beginningOffset int, relativeLP *locPointer) *fileLocPointer {
flp := &fileLocPointer{fileSuffixNum: fileSuffixNum}
flp.offset = begginingOffset + relativeLP.offset
flp.offset = beginningOffset + relativeLP.offset
flp.bytesLength = relativeLP.bytesLength
return flp
}
......
......@@ -96,7 +96,7 @@ func (w *testBlockfileMgrWrapper) testGetBlockByNumber(blocks []*common.Block, s
// test getting the last block
b, err := w.blockfileMgr.retrieveBlockByNumber(math.MaxUint64)
iLastBlock := len(blocks) - 1
testutil.AssertNoError(w.t, err, fmt.Sprintf("Error while retrieving last block from blockfileMgr"))
testutil.AssertNoError(w.t, err, "Error while retrieving last block from blockfileMgr")
testutil.AssertEquals(w.t, b, blocks[iLastBlock])
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment