multi: start consumers with a starting blockbeat
This is needed so the consumers have an initial state about the current block.
This commit is contained in:
5 files changed
+60
-10
No files matched your search
+4
-1
@@ -795,13 +795,16 @@ type monitorRecord struct {
|
||||
|
||||
// Start starts the publisher by subscribing to block epoch updates and kicking
|
||||
// off the monitor loop.
|
||||
func (t *TxPublisher) Start() error {
|
||||
func (t *TxPublisher) Start(beat chainio.Blockbeat) error {
|
||||
log.Info("TxPublisher starting...")
|
||||
|
||||
if t.started.Swap(true) {
|
||||
return fmt.Errorf("TxPublisher started more than once")
|
||||
}
|
||||
|
||||
// Set the current height.
|
||||
t.currentHeight.Store(beat.Height())
|
||||
|
||||
t.wg.Add(1)
|
||||
go t.monitor()
|
||||
|
||||
|
||||
Reference in new issue
Block a user