forked from cwtch.im/cwtch
Merge pull request 'Activate Peers After Purging Retries' (#534) from stable-blockers into master
Reviewed-on: cwtch.im/cwtch#534 Reviewed-by: Dan Ballard <dan@openprivacy.ca>
This commit is contained in:
commit
51d146fb5c
11
app/app.go
11
app/app.go
|
@ -402,6 +402,12 @@ func (app *application) ActivatePeerEngine(onion string) {
|
||||||
func (app *application) ConfigureConnections(onion string, listen bool, peers bool, servers bool) {
|
func (app *application) ConfigureConnections(onion string, listen bool, peers bool, servers bool) {
|
||||||
profile := app.GetPeer(onion)
|
profile := app.GetPeer(onion)
|
||||||
if profile != nil {
|
if profile != nil {
|
||||||
|
|
||||||
|
// if we are making a decision to ignore
|
||||||
|
if !peers || !servers {
|
||||||
|
app.eventBuses[profile.GetOnion()].Publish(event.NewEventList(event.PurgeRetries))
|
||||||
|
}
|
||||||
|
|
||||||
// enable the engine if it doesn't exist...
|
// enable the engine if it doesn't exist...
|
||||||
// note: this function is idempotent
|
// note: this function is idempotent
|
||||||
app.ActivatePeerEngine(onion)
|
app.ActivatePeerEngine(onion)
|
||||||
|
@ -409,10 +415,7 @@ func (app *application) ConfigureConnections(onion string, listen bool, peers bo
|
||||||
profile.Listen()
|
profile.Listen()
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we are making a decision to ignore
|
|
||||||
if !peers || !servers {
|
|
||||||
app.eventBuses[profile.GetOnion()].Publish(event.NewEventList(event.PurgeRetries))
|
|
||||||
}
|
|
||||||
app.eventBuses[profile.GetOnion()].Publish(event.NewEventList(event.ResumeRetries))
|
app.eventBuses[profile.GetOnion()].Publish(event.NewEventList(event.ResumeRetries))
|
||||||
profile.StartConnections(peers, servers)
|
profile.StartConnections(peers, servers)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue