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
@@ -441,7 +441,7 @@ func New(cfg *UtxoSweeperConfig) *UtxoSweeper {
|
||||
}
|
||||
|
||||
// Start starts the process of constructing and publish sweep txes.
|
||||
func (s *UtxoSweeper) Start() error {
|
||||
func (s *UtxoSweeper) Start(beat chainio.Blockbeat) error {
|
||||
if !atomic.CompareAndSwapUint32(&s.started, 0, 1) {
|
||||
return nil
|
||||
}
|
||||
@@ -452,6 +452,9 @@ func (s *UtxoSweeper) Start() error {
|
||||
// not change from here on.
|
||||
s.relayFeeRate = s.cfg.FeeEstimator.RelayFeePerKW()
|
||||
|
||||
// Set the current height.
|
||||
s.currentHeight = beat.Height()
|
||||
|
||||
// Start sweeper main loop.
|
||||
s.wg.Add(1)
|
||||
go s.collector()
|
||||
|
||||
Reference in new issue
Block a user