@@ -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