Skip to content

Commit

Permalink
remove an unused parameter
Browse files Browse the repository at this point in the history
This commit removes an unused parameter named "namespace"
from a function that computes the expiring block number
for a private key stored in a collection with a "block to live"
policy.

Signed-off-by: senthil <cendhu@gmail.com>
  • Loading branch information
cendhu committed Oct 10, 2023
1 parent d5b6c10 commit ff3baf9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/ledger/pvtdatapolicy/btlpolicy.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ func (p *LSCCBasedBTLPolicy) GetExpiringBlock(namespace string, collection strin
if err != nil {
return 0, err
}
return ComputeExpiringBlock(namespace, collection, committingBlock, btl), nil
return ComputeExpiringBlock(collection, committingBlock, btl), nil
}

func ComputeExpiringBlock(namespace, collection string, committingBlock, btl uint64) uint64 {
func ComputeExpiringBlock(collection string, committingBlock, btl uint64) uint64 {
expiryBlk := committingBlock + btl + uint64(1)
if expiryBlk <= committingBlock { // committingBlk + btl overflows uint64-max
expiryBlk = math.MaxUint64
Expand Down
2 changes: 1 addition & 1 deletion core/ledger/pvtdatastorage/snapshot_data_importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ func (i *eligibilityAndBTLCache) hasExpiry(namespace, collection string, committ
coll: collection,
}]
if ok {
expiringBlk = pvtdatapolicy.ComputeExpiringBlock(namespace, collection, committingBlk, btl)
expiringBlk = pvtdatapolicy.ComputeExpiringBlock(collection, committingBlk, btl)
}
return expiringBlk < math.MaxUint64, expiringBlk
}
Expand Down

0 comments on commit ff3baf9

Please sign in to comment.