tendermint/consensus/common.go

16 lines
380 B
Go
Raw Normal View History

package consensus
import (
2016-10-09 23:58:13 -07:00
"github.com/tendermint/tendermint/types"
)
// NOTE: this is blocking
2016-10-09 23:58:13 -07:00
func subscribeToEvent(evsw types.EventSwitch, receiver, eventID string, chanCap int) chan interface{} {
// listen for new round
ch := make(chan interface{}, chanCap)
2016-10-09 23:58:13 -07:00
types.AddListenerForEvent(evsw, receiver, eventID, func(data types.TMEventData) {
ch <- data
})
return ch
}