Skip to content

Commit

Permalink
fix: avoid blocking when refresh and keygen fail (#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetrun5 authored Apr 10, 2024
1 parent de153be commit 3bce952
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions chains/evm/listener/eventHandlers/event-handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,11 @@ func (eh *KeygenEventHandler) HandleEvents(

keygenBlockNumber := big.NewInt(0).SetUint64(keygenEvents[0].BlockNumber)
keygen := keygen.NewKeygen(eh.sessionID(keygenBlockNumber), eh.threshold, eh.host, eh.communication, eh.storer)
return eh.coordinator.Execute(context.Background(), keygen, make(chan interface{}, 1))
err = eh.coordinator.Execute(context.Background(), keygen, make(chan interface{}, 1))
if err != nil {
log.Err(err).Msgf("Failed executing keygen")
}
return nil
}

func (eh *KeygenEventHandler) sessionID(block *big.Int) string {
Expand Down Expand Up @@ -262,7 +266,11 @@ func (eh *RefreshEventHandler) HandleEvents(
resharing := resharing.NewResharing(
eh.sessionID(startBlock), topology.Threshold, eh.host, eh.communication, eh.storer,
)
return eh.coordinator.Execute(context.Background(), resharing, make(chan interface{}, 1))
err = eh.coordinator.Execute(context.Background(), resharing, make(chan interface{}, 1))
if err != nil {
log.Err(err).Msgf("Failed executing key refresh")
}
return nil
}

func (eh *RefreshEventHandler) sessionID(block *big.Int) string {
Expand Down

0 comments on commit 3bce952

Please sign in to comment.