Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MainNet commitments
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
archives
MainNet commitments
Commits
69771b65
Commit
69771b65
authored
Nov 17, 2021
by
Jonah Husson
Browse files
Options
Downloads
Patches
Plain Diff
Remove mutex from db impl
parent
f1331f93
Branches
dev
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
server/serverImpl.go
+1
-0
1 addition, 0 deletions
server/serverImpl.go
storage/database.go
+0
-2
0 additions, 2 deletions
storage/database.go
storage/dbImpl.go
+0
-6
0 additions, 6 deletions
storage/dbImpl.go
with
1 addition
and
8 deletions
server/serverImpl.go
+
1
−
0
View file @
69771b65
...
...
@@ -206,6 +206,7 @@ func (i *Impl) Verify(_ context.Context, msg messages.Commitment) error {
jww
.
ERROR
.
Println
(
err
)
return
err
}
jww
.
INFO
.
Printf
(
"Registered commitment from %+v [%+v]"
,
idfStruct
.
ID
,
msg
.
Wallet
)
return
nil
}
...
...
This diff is collapsed.
Click to expand it.
storage/database.go
+
0
−
2
View file @
69771b65
...
...
@@ -14,7 +14,6 @@ import (
"gorm.io/driver/postgres"
"gorm.io/gorm"
"gorm.io/gorm/logger"
"sync"
"time"
)
...
...
@@ -27,7 +26,6 @@ type database interface {
// DatabaseImpl struct implements the Database Interface with an underlying DB
type
DatabaseImpl
struct
{
sync
.
RWMutex
db
*
gorm
.
DB
// Stored database connection
}
...
...
This diff is collapsed.
Click to expand it.
storage/dbImpl.go
+
0
−
6
View file @
69771b65
...
...
@@ -13,20 +13,14 @@ import (
)
func
(
db
*
DatabaseImpl
)
InsertMembers
(
members
[]
Member
)
error
{
db
.
Lock
()
defer
db
.
Unlock
()
return
db
.
db
.
Create
(
&
members
)
.
Error
}
func
(
db
*
DatabaseImpl
)
InsertCommitment
(
commitment
Commitment
)
error
{
db
.
Lock
()
defer
db
.
Unlock
()
return
db
.
db
.
Clauses
(
clause
.
OnConflict
{
UpdateAll
:
true
})
.
Create
(
&
commitment
)
.
Error
}
func
(
db
*
DatabaseImpl
)
GetMember
(
id
string
)
(
*
Member
,
error
)
{
db
.
RLock
()
defer
db
.
RUnlock
()
jww
.
INFO
.
Printf
(
"Getting member with id %+v"
,
id
)
m
:=
Member
{}
return
&
m
,
db
.
db
.
First
(
&
m
,
"id = ?"
,
id
)
.
Error
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment