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
Levin Zimmermann
neoppod
Commits
195b80a3
Commit
195b80a3
authored
Aug 02, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
aba6d115
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
37 deletions
+0
-37
go/neo/x_connection.go
go/neo/x_connection.go
+0
-37
No files found.
go/neo/x_connection.go
View file @
195b80a3
...
@@ -41,40 +41,3 @@ func ErrDecode(e *Error) error {
...
@@ -41,40 +41,3 @@ func ErrDecode(e *Error) error {
return
e
return
e
}
}
// ------------------------------------------
// XXX place=?
// IdentifyWith identifies local node with remote peer
// it also verifies peer's node type to what caller expects
func
IdentifyWith
(
expectPeerType
NodeType
,
link
*
NodeLink
,
myInfo
NodeInfo
,
clusterName
string
)
(
accept
*
AcceptIdentification
,
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"%s: request identification"
,
link
)
conn
,
err
:=
link
.
NewConn
()
if
err
!=
nil
{
return
nil
,
err
}
defer
func
()
{
err2
:=
conn
.
Close
()
err
=
xerr
.
First
(
err
,
err2
)
}()
accept
=
&
AcceptIdentification
{}
err
=
conn
.
Ask
(
&
RequestIdentification
{
NodeType
:
myInfo
.
NodeType
,
NodeUUID
:
myInfo
.
NodeUUID
,
Address
:
myInfo
.
Address
,
ClusterName
:
clusterName
,
IdTimestamp
:
myInfo
.
IdTimestamp
,
// XXX ok?
},
accept
)
if
err
!=
nil
{
return
nil
,
err
// XXX err ctx ?
}
if
accept
.
NodeType
!=
expectPeerType
{
return
nil
,
fmt
.
Errorf
(
"accepted, but peer is not %v (identifies as %v)"
,
expectPeerType
,
accept
.
NodeType
)
}
return
accept
,
nil
}
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