You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
380 B

  1. package consensus
  2. import (
  3. "github.com/tendermint/tendermint/types"
  4. )
  5. // NOTE: this is blocking
  6. func subscribeToEvent(evsw types.EventSwitch, receiver, eventID string, chanCap int) chan interface{} {
  7. // listen for new round
  8. ch := make(chan interface{}, chanCap)
  9. types.AddListenerForEvent(evsw, receiver, eventID, func(data types.TMEventData) {
  10. ch <- data
  11. })
  12. return ch
  13. }