Skip to content

Commit d1c28f1

Browse files
authored
Merge pull request #283 from blinklabs-io/fix/handshake-full-duplex
fix: only act in full-duplex mode if we asked for it
2 parents a878eeb + 3df92a9 commit d1c28f1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

connection.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,15 +334,15 @@ func (c *Connection) setupConnection() error {
334334
}
335335
// Start protocols
336336
if !c.delayProtocolStart {
337-
if handshakeFullDuplex || !c.server {
337+
if (c.fullDuplex && handshakeFullDuplex) || !c.server {
338338
c.blockFetch.Client.Start()
339339
c.chainSync.Client.Start()
340340
c.txSubmission.Client.Start()
341341
if c.peerSharing != nil {
342342
c.peerSharing.Client.Start()
343343
}
344344
}
345-
if handshakeFullDuplex || c.server {
345+
if (c.fullDuplex && handshakeFullDuplex) || c.server {
346346
c.blockFetch.Server.Start()
347347
c.chainSync.Server.Start()
348348
c.txSubmission.Server.Start()
@@ -364,7 +364,7 @@ func (c *Connection) setupConnection() error {
364364
}
365365
// Start protocols
366366
if !c.delayProtocolStart {
367-
if handshakeFullDuplex || !c.server {
367+
if (c.fullDuplex && handshakeFullDuplex) || !c.server {
368368
c.chainSync.Client.Start()
369369
c.localTxSubmission.Client.Start()
370370
if c.localStateQuery != nil {
@@ -374,7 +374,7 @@ func (c *Connection) setupConnection() error {
374374
c.localTxMonitor.Client.Start()
375375
}
376376
}
377-
if handshakeFullDuplex || c.server {
377+
if (c.fullDuplex && handshakeFullDuplex) || c.server {
378378
c.chainSync.Server.Start()
379379
c.localTxSubmission.Server.Start()
380380
if c.localStateQuery != nil {

0 commit comments

Comments
 (0)