Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
neoppod
Commits
3f516cd6
Commit
3f516cd6
authored
Apr 04, 2023
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage: small code simplification
parent
f7f8533a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
neo/storage/handlers/identification.py
neo/storage/handlers/identification.py
+2
-5
No files found.
neo/storage/handlers/identification.py
View file @
3f516cd6
...
@@ -41,8 +41,7 @@ class IdentificationHandler(EventHandler):
...
@@ -41,8 +41,7 @@ class IdentificationHandler(EventHandler):
if
uuid
is
None
:
if
uuid
is
None
:
if
node_type
!=
NodeTypes
.
STORAGE
:
if
node_type
!=
NodeTypes
.
STORAGE
:
raise
ProtocolError
(
'reject anonymous non-storage node'
)
raise
ProtocolError
(
'reject anonymous non-storage node'
)
handler
=
StorageOperationHandler
(
self
.
app
)
conn
.
setHandler
(
StorageOperationHandler
(
app
))
conn
.
setHandler
(
handler
)
else
:
else
:
if
uuid
==
app
.
uuid
:
if
uuid
==
app
.
uuid
:
raise
ProtocolError
(
"uuid conflict or loopback connection"
)
raise
ProtocolError
(
"uuid conflict or loopback connection"
)
...
@@ -60,9 +59,7 @@ class IdentificationHandler(EventHandler):
...
@@ -60,9 +59,7 @@ class IdentificationHandler(EventHandler):
force
=
app
.
uuid
<
uuid
force
=
app
.
uuid
<
uuid
else
:
else
:
raise
ProtocolError
(
'reject non-client-or-storage node'
)
raise
ProtocolError
(
'reject non-client-or-storage node'
)
# apply the handler and set up the connection
conn
.
setHandler
(
handler
(
app
))
handler
=
handler
(
self
.
app
)
conn
.
setHandler
(
handler
)
node
.
setConnection
(
conn
,
force
)
node
.
setConnection
(
conn
,
force
)
# accept the identification and trigger an event
# accept the identification and trigger an event
conn
.
answer
(
Packets
.
AcceptIdentification
(
conn
.
answer
(
Packets
.
AcceptIdentification
(
...
...
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