From 234705ddc5ecca397668ba140a17b10c23aa660e Mon Sep 17 00:00:00 2001 From: Acha Bill Date: Tue, 23 Jan 2024 13:33:57 +0100 Subject: [PATCH] chore: refactor --- pkg/postage/stamper.go | 4 ++-- pkg/postage/stampissuer.go | 8 -------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/pkg/postage/stamper.go b/pkg/postage/stamper.go index a13261fe2d8..e7b8d51b4c5 100644 --- a/pkg/postage/stamper.go +++ b/pkg/postage/stamper.go @@ -7,11 +7,11 @@ package postage import ( "errors" "fmt" - "resenje.org/multex" "github.com/ethersphere/bee/pkg/crypto" "github.com/ethersphere/bee/pkg/storage" "github.com/ethersphere/bee/pkg/swarm" + "resenje.org/multex" ) var ( @@ -50,7 +50,7 @@ func (st *stamper) Stamp(addr swarm.Address) (*Stamp, error) { } switch err := st.store.Get(item); { case err == nil: - if st.issuer.assigned(item.BatchIndex) || st.issuer.ImmutableFlag() { + if st.issuer.ImmutableFlag() { break } item.BatchTimestamp = unixTime() diff --git a/pkg/postage/stampissuer.go b/pkg/postage/stampissuer.go index 2606feb36eb..84b5292528a 100644 --- a/pkg/postage/stampissuer.go +++ b/pkg/postage/stampissuer.go @@ -201,14 +201,6 @@ func (si *StampIssuer) increment(addr swarm.Address) (batchIndex []byte, batchTi return indexToBytes(bIdx, bCnt), unixTime(), nil } -// check if this stamp index has already been assigned -func (si *StampIssuer) assigned(stampIdx []byte) bool { - si.bucketMtx.Lock() - defer si.bucketMtx.Unlock() - b, idx := BucketIndexFromBytes(stampIdx) - return idx < si.data.Buckets[b] -} - // Label returns the label of the issuer. func (si *StampIssuer) Label() string { return si.data.Label