Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
duniter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
typescript
duniter
Commits
7591dfc8
Commit
7591dfc8
authored
7 years ago
by
Éloïs
Browse files
Options
Downloads
Patches
Plain Diff
Allow ws2p connections to endpoints with the same uuid but different pubkey
parent
60da2608
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/modules/ws2p/lib/WS2PCluster.ts
+2
-2
2 additions, 2 deletions
app/modules/ws2p/lib/WS2PCluster.ts
with
2 additions
and
2 deletions
app/modules/ws2p/lib/WS2PCluster.ts
+
2
−
2
View file @
7591dfc8
...
...
@@ -348,7 +348,7 @@ export class WS2PCluster {
if
(
api
)
{
try
{
// We do not connect to local host
if
(
!
this
.
server
.
conf
.
ws2p
||
api
.
uuid
!==
this
.
server
.
conf
.
ws2p
.
uuid
)
{
if
(
!
this
.
server
.
conf
.
ws2p
||
api
.
uuid
!==
this
.
server
.
conf
.
ws2p
.
uuid
||
p
.
pubkey
!==
this
.
server
.
conf
.
pair
.
pub
)
{
await
this
.
connectToRemoteWS
(
api
.
host
,
api
.
port
,
api
.
path
,
this
.
messageHandler
,
p
.
pubkey
,
api
.
uuid
)
}
}
catch
(
e
)
{
...
...
@@ -376,7 +376,7 @@ export class WS2PCluster {
// Check if already connected to the pubkey (in any way: server or client)
const
connectedPubkeys
=
this
.
getConnectedPubkeys
()
const
shouldAccept
=
await
this
.
acceptPubkey
(
peer
.
pubkey
,
connectedPubkeys
,
()
=>
this
.
clientsCount
(),
this
.
maxLevel1Size
,
(
this
.
server
.
conf
.
ws2p
&&
this
.
server
.
conf
.
ws2p
.
preferedNodes
||
[]),
ws2pEnpoint
.
uuid
)
if
(
shouldAccept
)
{
if
(
shouldAccept
&&
(
!
this
.
server
.
conf
.
ws2p
||
ws2pEnpoint
.
uuid
!==
this
.
server
.
conf
.
ws2p
.
uuid
||
peer
.
pubkey
!==
this
.
server
.
conf
.
pair
.
pub
)
)
{
await
this
.
connectToRemoteWS
(
ws2pEnpoint
.
host
,
ws2pEnpoint
.
port
,
ws2pEnpoint
.
path
,
this
.
messageHandler
,
peer
.
pubkey
)
await
this
.
trimClientConnections
()
}
...
...
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