From ff3baf9f4ad9f872ab3f21ea85c1567e39daedd6 Mon Sep 17 00:00:00 2001 From: senthil Date: Tue, 10 Oct 2023 16:05:42 +0530 Subject: [PATCH] remove an unused parameter 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 --- core/ledger/pvtdatapolicy/btlpolicy.go | 4 ++-- core/ledger/pvtdatastorage/snapshot_data_importer.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/ledger/pvtdatapolicy/btlpolicy.go b/core/ledger/pvtdatapolicy/btlpolicy.go index 116ae7b7360..7b02891f444 100644 --- a/core/ledger/pvtdatapolicy/btlpolicy.go +++ b/core/ledger/pvtdatapolicy/btlpolicy.go @@ -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 diff --git a/core/ledger/pvtdatastorage/snapshot_data_importer.go b/core/ledger/pvtdatastorage/snapshot_data_importer.go index cbaab71070a..7e3884b1e17 100644 --- a/core/ledger/pvtdatastorage/snapshot_data_importer.go +++ b/core/ledger/pvtdatastorage/snapshot_data_importer.go @@ -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 }