Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mybee
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
mybee
Commits
f1fa3b44
Unverified
Commit
f1fa3b44
authored
Jun 18, 2021
by
acud
Committed by
GitHub
Jun 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: duplicate issuers (#2128)
parent
c3c87289
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
13 deletions
+16
-13
service.go
pkg/postage/service.go
+16
-13
No files found.
pkg/postage/service.go
View file @
f1fa3b44
...
...
@@ -78,6 +78,12 @@ func NewService(store storage.StateStorer, postageStore Storer, chainID int64) (
func
(
ps
*
service
)
Add
(
st
*
StampIssuer
)
{
ps
.
lock
.
Lock
()
defer
ps
.
lock
.
Unlock
()
for
_
,
v
:=
range
ps
.
issuers
{
if
bytes
.
Equal
(
st
.
data
.
BatchID
,
v
.
data
.
BatchID
)
{
return
}
}
ps
.
issuers
=
append
(
ps
.
issuers
,
st
)
}
...
...
@@ -85,19 +91,16 @@ func (ps *service) Add(st *StampIssuer) {
// a batch creation event from the blockchain listener to ensure that if a stamp
// issuer was not created initially, we will create it here.
func
(
ps
*
service
)
Handle
(
b
*
Batch
)
{
_
,
err
:=
ps
.
GetStampIssuer
(
b
.
ID
)
if
errors
.
Is
(
err
,
ErrNotFound
)
{
ps
.
Add
(
NewStampIssuer
(
"recovered"
,
string
(
b
.
Owner
),
b
.
ID
,
b
.
Value
,
b
.
Depth
,
b
.
BucketDepth
,
b
.
Start
,
b
.
Immutable
,
))
}
ps
.
Add
(
NewStampIssuer
(
"recovered"
,
string
(
b
.
Owner
),
b
.
ID
,
b
.
Value
,
b
.
Depth
,
b
.
BucketDepth
,
b
.
Start
,
b
.
Immutable
,
))
}
// StampIssuers returns the currently active stamp issuers.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment