Initialize journal writer soon after loading instead of waiting for the first time rejournal.

Previously, the journal writer is nil until the first time rejournal (default 1h), which means during this period, txs submitted to this node are not written into journal file.
This commit is contained in:
Kyrin 2025-10-16 11:52:52 +08:00 committed by GitHub
parent 7c107c2691
commit 5bac720fd4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -185,6 +185,12 @@ func (tracker *TxTracker) loop() {
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 (