Skip to content

Commit

Permalink
chore: refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
acha-bill committed Jan 23, 2024
1 parent bf3c78e commit 234705d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
4 changes: 2 additions & 2 deletions pkg/postage/stamper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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()
Expand Down
8 changes: 0 additions & 8 deletions pkg/postage/stampissuer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 234705d

Please sign in to comment.