Skip to content

Commit b7f2cfd

Browse files
authored
Merge pull request #438 from blinklabs-io/fix/conn-server-keepalive
fix: start keepalive server
2 parents 7632745 + 0d9937a commit b7f2cfd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

connection.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,6 @@ func (c *Connection) setupConnection() error {
346346
c.txSubmission = txsubmission.New(protoOptions, c.txSubmissionConfig)
347347
if versionNtN.EnableKeepAliveProtocol {
348348
c.keepAlive = keepalive.New(protoOptions, c.keepAliveConfig)
349-
if !c.server && c.sendKeepAlives {
350-
c.keepAlive.Client.Start()
351-
}
352349
}
353350
if versionNtN.EnablePeerSharingProtocol {
354351
c.peerSharing = peersharing.New(protoOptions, c.peerSharingConfig)
@@ -359,6 +356,9 @@ func (c *Connection) setupConnection() error {
359356
c.blockFetch.Client.Start()
360357
c.chainSync.Client.Start()
361358
c.txSubmission.Client.Start()
359+
if c.keepAlive != nil && c.sendKeepAlives {
360+
c.keepAlive.Client.Start()
361+
}
362362
if c.peerSharing != nil {
363363
c.peerSharing.Client.Start()
364364
}
@@ -367,6 +367,9 @@ func (c *Connection) setupConnection() error {
367367
c.blockFetch.Server.Start()
368368
c.chainSync.Server.Start()
369369
c.txSubmission.Server.Start()
370+
if c.keepAlive != nil {
371+
c.keepAlive.Server.Start()
372+
}
370373
if c.peerSharing != nil {
371374
c.peerSharing.Server.Start()
372375
}

0 commit comments

Comments
 (0)