Browse Source

Set the App Before Initializing The App Over the Connection...

chainbug
Sarah Jamie Lewis 10 months ago
parent
commit
759ab44a47
  1. 6
      applications/application_chain.go

6
applications/application_chain.go

@ -40,13 +40,17 @@ func (appchain *ApplicationChain) NewInstance() tapir.Application {
func (appchain *ApplicationChain) Init(connection tapir.Connection) {
appchain.TranscriptApp.Init(connection)
for i, app := range appchain.apps {
// propagate the transcript to the app
app.PropagateTranscript(appchain.transcript)
// apply the app to the connection
connection.SetApp(app)
// initialize the application given the connection
app.Init(connection)
// if we hit our guard then carry on, otherwise close...
if !connection.HasCapability(appchain.capabilities[i]) {
connection.Close()
return
}
connection.SetApp(app)
}
}

Loading…
Cancel
Save