This repository was archived by the owner on Aug 23, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,13 @@ module.exports = function connection (swarm) {
95
95
} ,
96
96
97
97
enableRelayDialing ( config ) {
98
+ config = config ||
99
+ {
100
+ circuit : {
101
+ enabled : false
102
+ }
103
+ }
104
+
98
105
swarm . relay = true
99
106
swarm . transport . add ( Circuit . tag , new Circuit . Dialer ( swarm , config ) )
100
107
} ,
Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ module.exports = function process (swarm) {
10
10
return ( pi , protocol , proxyConn ) => {
11
11
const b58Id = pi . id . toB58String ( )
12
12
13
+ const ms = new multistream . Dialer ( )
13
14
function cryptoDial ( conn , cb ) {
14
- const ms = new multistream . Dialer ( )
15
15
ms . handle ( conn , ( err ) => {
16
16
if ( err ) {
17
17
return cb ( err )
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ function Swarm (peerInfo, peerBook) {
70
70
return myTransports . filter ( ( ts ) => this . transports [ ts ] . filter ( myAddrs ) . length > 0 )
71
71
// push Circuit to be the last proto to be dialed
72
72
. sort ( ( a ) => {
73
- return a . tag && a . tag === 'Circuit' ? - 1 : 0
73
+ return a . tag && a . tag === 'Circuit' ? - 1 : 1
74
74
} )
75
75
}
76
76
You can’t perform that action at this time.
0 commit comments