Skip to content

Commit

Permalink
[FAB-1686]Remove unused arg,method,variable
Browse files Browse the repository at this point in the history
https://jira.hyperledger.org/browse/FAB-1686

Change-Id: I0b2d784f52f4f38f6afa03ca750188c369b2cc62
Signed-off-by: grapebaba <281165273@qq.com>
  • Loading branch information
GrapeBaBa committed Jan 19, 2017
1 parent 22ec03f commit 524c96e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
1 change: 0 additions & 1 deletion core/ledger/blkstorage/fsblkstorage/blockfile_mgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
var logger = logging.MustGetLogger("kvledger")

const (
blockIndexCF = "blockIndexCF"
blockfilePrefix = "blockfile_"
)

Expand Down
12 changes: 4 additions & 8 deletions core/ledger/blkstorage/fsblkstorage/blockindex.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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)
}
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion core/ledger/blkstorage/fsblkstorage/pkg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
}

Expand Down

0 comments on commit 524c96e

Please sign in to comment.