mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
Refactor journal writer initialization in TxTracker
This commit is contained in:
parent
d54173f994
commit
24338b8817
1 changed files with 4 additions and 6 deletions
|
|
@ -181,16 +181,14 @@ func (tracker *TxTracker) loop() {
|
|||
defer tracker.wg.Done()
|
||||
|
||||
if tracker.journal != nil {
|
||||
log.Info("Initializing journal writer")
|
||||
if err := tracker.journal.rotate(make(map[common.Address]types.Transactions)); err != nil {
|
||||
log.Warn("Failed to initialize journal writer", "err", err)
|
||||
}
|
||||
tracker.journal.load(func(transactions []*types.Transaction) []error {
|
||||
tracker.TrackAll(transactions)
|
||||
return nil
|
||||
})
|
||||
|
||||
log.Info("Initializing journal writer after loading transactions")
|
||||
if err := tracker.journal.rotate(make(map[common.Address]types.Transactions)); err != nil {
|
||||
log.Warn("Failed to initialize journal writer", "err", err)
|
||||
}
|
||||
|
||||
defer tracker.journal.close()
|
||||
}
|
||||
var (
|
||||
|
|
|
|||
Loading…
Reference in a new issue