Skip to content

Commit

Permalink
[Keystone] Fix init order for Peer Wrapper and Dispatcher (#13976)
Browse files Browse the repository at this point in the history
  • Loading branch information
bolekk authored Aug 1, 2024
1 parent 94aa60d commit 610a516
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions core/services/chainlink/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,15 @@ func NewApplication(opts ApplicationOpts) (Application, error) {
externalPeer := externalp2p.NewExternalPeerWrapper(keyStore.P2P(), cfg.Capabilities().Peering(), opts.DS, globalLogger)
signer := externalPeer
externalPeerWrapper = externalPeer
remoteDispatcher := remote.NewDispatcher(externalPeerWrapper, signer, opts.CapabilitiesRegistry, globalLogger)
srvcs = append(srvcs, remoteDispatcher)

dispatcher = remoteDispatcher
} else {
dispatcher = remote.NewDispatcher(externalPeerWrapper, signer, opts.CapabilitiesRegistry, globalLogger)
srvcs = append(srvcs, externalPeerWrapper) // peer wrapper must be started before dispatcher
srvcs = append(srvcs, dispatcher)
} else { // tests only
dispatcher = opts.CapabilitiesDispatcher
externalPeerWrapper = opts.CapabilitiesPeerWrapper
srvcs = append(srvcs, externalPeerWrapper)
}

srvcs = append(srvcs, externalPeerWrapper)

rid := cfg.Capabilities().ExternalRegistry().RelayID()
registryAddress := cfg.Capabilities().ExternalRegistry().Address()
relayer, err := relayerChainInterops.Get(rid)
Expand Down

0 comments on commit 610a516

Please sign in to comment.