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
ce46f6c3
Commit
ce46f6c3
authored
Mar 9, 2022
by
Jonah Husson
Browse files
Options
Downloads
Patches
Plain Diff
MR fixes
parent
ab82fcdb
No related branches found
No related tags found
1 merge request
!10
Draft: November commitments
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
server/serverImpl.go
+7
-4
7 additions, 4 deletions
server/serverImpl.go
with
7 additions
and
4 deletions
server/serverImpl.go
+
7
−
4
View file @
ce46f6c3
...
...
@@ -28,7 +28,7 @@ import (
"gitlab.com/xx_network/crypto/signature/rsa"
"gitlab.com/xx_network/primitives/id"
"gitlab.com/xx_network/primitives/id/idf"
utils
2
"gitlab.com/xx_network/primitives/utils"
path
utils
"gitlab.com/xx_network/primitives/utils"
"net/http"
"testing"
"time"
...
...
@@ -51,15 +51,17 @@ func StartServer(params Params, s *storage.Storage) error {
idList
:
map
[
string
]
interface
{}{},
}
if
p
,
err
:=
utils2
.
ExpandPath
(
params
.
IDListPath
);
err
==
nil
{
idList
,
err
:=
utils2
.
ReadFile
(
p
)
// Attempt to load in list of node IDs exempt from duplicate wallet checking
if
p
,
err
:=
pathutils
.
ExpandPath
(
params
.
IDListPath
);
err
==
nil
{
idList
,
err
:=
pathutils
.
ReadFile
(
p
)
if
err
!=
nil
{
return
errors
.
WithMessage
(
err
,
"Failed to read ID list path"
)
}
r
:=
csv
.
NewReader
(
bytes
.
NewReader
(
idList
))
records
,
err
:=
r
.
ReadAll
()
for
_
,
r
:=
range
records
{
impl
.
idList
[
r
[
0
]]
=
true
nid
:=
r
[
0
]
impl
.
idList
[
nid
]
=
true
}
}
else
{
return
errors
.
WithMessage
(
err
,
"Failed to expand ID list path"
)
...
...
@@ -212,6 +214,7 @@ func (i *Impl) Verify(_ context.Context, msg messages.Commitment) error {
}
// Check if wallet is in old commitments
// Only check this if node ID is not in exempt list
if
_
,
ok
:=
i
.
idList
[
nid
.
String
()];
!
ok
{
ok
,
err
=
i
.
s
.
CheckWallet
(
msg
.
PaymentWallet
)
if
err
!=
nil
{
...
...
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